This file contains 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
y |
This file contains 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/sh -- | |
# \ | |
exec tclsh -encoding ascii "$0" "$@" | |
# usage: actually_playable_zork [zork_command] [save_file] | |
package require Expect | |
if {$::argc >= 1} { | |
set zork [lindex $::argv 0] |
This file contains 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 - | |
get_rect() { | |
local target | |
target=$(bspc query -N -n "$1.floating") || return | |
bspc subscribe node_geometry | while IFS=' ' read -r _ _ _ wid rect; do | |
if (( wid == target )); then | |
printf '%s\n' "$rect" | |
break | |
fi |
This file contains 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
function hvcoo(p, f, hv) { | |
if (hv == "h") | |
return p SUBSEP f | |
return f SUBSEP p | |
} | |
BEGIN { FS = ",| -> " } | |
$1 == $3 { hv = "v"; f = $1; a = $2; b = $4 } | |
$2 == $4 { hv = "h"; f = $2; a = $1; b = $3 } |
This file contains 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 -- | |
if [[ $# != 1 ]]; then | |
printf >&2 'Usage: jcsvid URL\n' | |
exit 2 | |
fi | |
eval -- "$(curl -LSgs -- "$1" | xj | jq -r ' | |
first( | |
.. | .video? | arrays | |
This file contains 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/sh -- | |
# \ | |
exec jq --unbuffered --stream -rn --args -f "$0" -- "$@" | |
$ARGS.positional | | |
if length != 1 then | |
@json "Invalid arguments: \(.).\n" | halt_error(2) | |
else . end | | |
( | |
.[0] | |
This file contains 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 -- | |
# https://lists.gnu.org/archive/html/bug-bash/2022-05/msg00052.html | |
bashrematch_push () { | |
local BASH_REMATCH a | |
for a | |
do [[ $a =~ .* ]] | |
done | |
} | |
bashrematch_pop () { |
This file contains 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/sh -- | |
# \ | |
exec jq -Crf "$0" -- "$@" | |
def children: | |
objects | | |
.path as $p | | |
(.firstChild | objects | .path = $p + "/1"), | |
(.secondChild | objects | .path = $p + "/2") | | |
select(has("id")); |
This file contains 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
1s/^/1 / | |
2,$g/^/-t -\ | |
s/ .*//\ | |
s/^9*$/0&/\ | |
t .\ | |
s/^.*[^9]\(9*\)$/\1 /\ | |
s/9/0/g\ | |
-s/9*$//\ | |
s/8$/9/\ | |
s/7$/8/\ |
OlderNewer