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
#!/usr/bin/env bash | |
wx=24 | |
wy=9 | |
px=18 | |
py=4 | |
cy=4 | |
cx=1 |
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 | |
function quote_args() { | |
SPACER= | |
while [[ $# -gt 0 ]]; do | |
printf "%s\"%s\"" "$SPACER" "${1//\"/\\\"}" | |
shift | |
SPACER=' ' | |
done | |
} |
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 | |
popup() { | |
TMP="$(mktemp)" | |
trap "rm $TMP" EXIT | |
cat > "$TMP" | |
tmux display-popup -w $WIDTH -h $HEIGHT $* "cat \"$TMP\" | termsand" | |
} | |
PANE=$(tmux display -p "#{pane_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
#!/bin/bash | |
ARR1=(1 2 3 4 5) | |
ARR2=(2 3 4 5 6) | |
K=5 | |
declare -a priority_queue |
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
APP_NAME="bash"; COOKIE_STR="$(cat ~/.uploadthingcookie)"; \ | |
JWT="$(curl -Ss \ | |
'https://clerk.uploadthing.com/v1/client/sessions/sess_2dW3vhIqxSNMjfSOZnFoDgWHYfZ/tokens?_clerk_js_version=4.70.3' \ | |
-X 'POST' \ | |
-H 'authority: clerk.uploadthing.com' \ | |
-H 'accept: */*' \ | |
-H 'accept-language: en-US,en;q=0.9' \ | |
-H 'content-length: 0' \ | |
-H 'content-type: application/x-www-form-urlencoded' \ | |
-H "$COOKIE_STR" \ |
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
#!/usr/bin/env bash | |
function house_builder() { | |
# floors,rooms,has_garage | |
echo "0,0,0" | |
} | |
function set_field() { | |
local f r g | |
IFS=, read f r g |
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
htmx_page <<-EOF | |
<script> | |
window.addEventListener("DOMContentLoaded", () => { | |
htmx.trigger("#thing", "myEvent", {answer : 42}); | |
}); | |
</script> | |
<div id="thing" hx-trigger="myEvent" hx-post="/test"></div> | |
EOF |
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 | |
cd /var/lib/docker/volumes/root_ld54volume/_data | |
list_scores() { | |
for LEVEL in {0..14}; do | |
SCORE_AND_USER=$(sort $LEVEL -n | head -1) | |
SCORE=$(echo "$SCORE_AND_USER" | cut -d' ' -f1) | |
USER=$(echo "$SCORE_AND_USER" | cut -d' ' -f2) | |
FREQ=$(sort -u "$LEVEL" | grep -c '^'"$SCORE ") |
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
/////////////////////////// | |
// Client | |
/////////////////////////// | |
// when the user clicks the 'login with twitch' button... | |
document.location = | |
`https://id.twitch.tv/oauth2/authorize` + | |
`?client_id=${TWITCH_CLIENT_ID}` + | |
`&redirect_uri=${redirect}` + | |
`&response_type=token`; |
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
// try it out here: https://codesandbox.io/s/recursing-meadow-t87lvp?file=/src/index.js | |
export const machine = createMachine( | |
{ | |
id: "fizzbuzz", | |
context: { | |
i: "0" | |
}, | |
initial: "Start", | |
states: { |
NewerOlder