This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use File::Find; | |
| use Cwd 'abs_path'; | |
| use File::Basename 'basename'; | |
| # --- Configuration --- | |
| # Set to 1 to see files that were scanned but not changed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # dependencies = [ | |
| # "bleak", | |
| # ] | |
| # /// | |
| import asyncio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/data/data/com.termux/files/usr/bin/bash -eux | |
| # This script sets the screen timeout to 1 hour to keep the phone awake | |
| # First enable wireless debugging and pkg install android-tools and nmap | |
| # Do adb pair localhost:<port number> and enter code from Settings app | |
| PORT=$(nmap -sT localhost -p30000-49999 | awk -F/ '/tcp open/{print $1}') | |
| echo "Connecting to localhost:$PORT" | |
| adb connect localhost:$PORT || exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffi = require("ffi") | |
| C = ffi.C | |
| ffi.cdef([[ | |
| typedef struct objc_object *id; | |
| typedef struct objc_selector *SEL; | |
| id objc_getClass(const char*); | |
| SEL sel_registerName(const char*); | |
| id objc_msgSend(id,SEL); | |
| id NSPasteboardTypeString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env lua | |
| local uv = require("luv") | |
| local port = arg[1] or "/dev/ttyUSB0" | |
| local baud = arg[2] or 115200 | |
| local read_fd = assert(uv.fs_open(port, "r", tonumber("666", 8))) | |
| local write_fd = assert(uv.fs_open(port, "w", tonumber("666", 8))) | |
| os.execute("stty -F " .. port .. " " .. baud .. " raw -echo -echoe -echok") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # lua.nix | |
| { config, lib, pkgs, ... }: | |
| with pkgs; let | |
| luaprompt = luajitPackages.buildLuarocksPackage { | |
| pname = "luaprompt"; | |
| version = "0.7-1"; | |
| knownRockspec = (fetchurl { | |
| url = "https://luarocks.org/luaprompt-0.7-1.rockspec"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz") { } | |
| , pkgs_x86_64 ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz") { localSystem = "x86_64-darwin"; } | |
| }: | |
| with pkgs.python38Packages; | |
| let | |
| cascadetoml = buildPythonPackage rec { | |
| pname = "cascadetoml"; | |
| version = "0.3.0"; | |
| src = fetchPypi { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| IP=192.168.86.24 | |
| PORT=38899 | |
| while : | |
| do | |
| HOURS=$(date +"%-H") | |
| MINUTES=$(date +"%-M") | |
| MINUTES=$(($HOURS * 60 + $MINUTES)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Copyright (c) 2019 Michael Mogenson | |
| * MIT license https://opensource.org/licenses/MIT | |
| */ | |
| /* This contrived example demonstrates the use of the comma operator and | |
| * variadic arguments to create a function-like macro that accepts an optional | |
| * argument and provides a default value when no argument is supplied. | |
| * | |
| * C's comma operator will evaluate the statement to the left of the comma and | |
| * return the value of the statement to the right. The line `if (i++, true)` is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class EnumType { | |
| static const int one = 1; | |
| } | |
| void printEnum(EnumType number) { | |
| print(number); | |
| } | |
| void main() { | |
| printEnum(EnumType.one); |
NewerOlder