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 bash | |
set -o errexit -o nounset -o pipefail | |
search_updates() { | |
if [[ $# -gt 0 ]]; then | |
for arg in "$@"; do | |
uv lock --dry-run --upgrade-package "$arg" | |
done | |
else | |
uv lock --dry-run --upgrade |
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 bash | |
set -o nounset | |
while read -r line; do | |
# Convert '+' to ' ' | |
with_spaces="${line//+/ }" | |
# Decode hex-encoded stuff using \x backslash escapes | |
printf '%b' "${with_spaces//%/\\x}" | |
done |
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 bash | |
set -o nounset | |
while IFS= read -r -n 1 char; do | |
case "$char" in | |
[-_.~a-zA-Z0-9]) | |
printf %s "$char" | |
;; | |
*) | |
printf '%%%02x' "'$char" |
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 bash | |
set -o errexit -o nounset -o pipefail | |
filters=( | |
'dangling=true' | |
'reference=registry.structure_test.oci.local/image:*' | |
'reference=cst.oci.local/*' | |
) | |
for arg in "$@"; do |
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 bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
print_usage() { | |
printf 'Usage: %s [-p PREFIX] [-w WIDTH] [WORDS...]\n' "$(basename "$0")" >&2 | |
} | |
width=80 |
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 bash | |
# A script that runs a co-process and waits until any process is accepting connections on a specific local TCP port. | |
# | |
# Upon successfully connecting to that given port, a SIGTERM is sent to the co-process. | |
# No timeout is applied while waiting, however this script can conveniently wrapped in a TIMEOUT(1) call. | |
# | |
# This script requires no external tools and will make use of Linux' /proc file system. | |
if [[ $# -lt 2 ]]; then | |
printf 'Usage: %s PORT COMMAND [ARGS...]\n' "$0" >&2 |
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
package de.janhicken.cfwithscala | |
import scala.scalajs.js.annotation.JSExportTopLevel | |
object CloudFunctions { | |
@JSExportTopLevel("helloWorld") | |
val helloWorld: CloudFunction = (request, response) ⇒ { | |
response.status(200).send("Hello World!") | |
} | |
} |