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 | |
die(){ | |
echo "$@" | |
exit 1 | |
} | |
APIKEY="$(gpg -qd ~/.config/apikey/openai.gpg)" | |
[ "$APIKEY" ] || die "Failed to fetch api key." |
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 | |
die(){ | |
echo "${@}" | |
exit 1 | |
} | |
list-targets(){ | |
find "${OTPDIR}" -type f -name '*.gpg' -printf '%P\n' | sed 's/.gpg$//g' | |
exit |
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 python | |
import os | |
from zipfile import ZipFile | |
import click | |
from jinja2 import Template | |
MANIFEST = r''' | |
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" |
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 python3 | |
from datetime import datetime | |
import click | |
from khal.settings import get_config | |
from khal.cli import build_collection | |
from icalendar import Calendar | |
@click.command() |
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 python3 | |
from argparse import ArgumentParser | |
from os import unlink, chmod | |
from os.path import expanduser | |
from socket import socket, AF_UNIX | |
from subprocess import run, Popen | |
from sys import stderr | |
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 -S gawk -f | |
$1~/^##+$/ && $0!~/Table of Contents$/{ | |
intoc = 0 | |
if (l > length($1)) for (k in num) if (k > length($1)) delete num[k] | |
l = length($1) | |
num[l] += 1 | |
r = q = substr($0, l + 2) | |
gsub(" ", "-", q); |
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 -S gawk -f | |
$1~/^##+$/ && $0!~/Table of Contents$/{ | |
if (l > length($1)) for (k in num) if (k > length($1)) delete num[k] | |
l = length($1) | |
num[l] += 1 | |
r = substr($0, l + 2) | |
p = ""; for (i in num) p = p num[i] "." | |
if (length(num) > 1) p = substr(p, 0, length(p) - 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
#!/usr/bin/env -S gawk -f | |
$1~/^##+$/{ | |
l = length($1); | |
r = q = substr($0, l + 2); | |
gsub(" ", "-", q); | |
printf "%" ((l - 2) * 4 + 2) "s[%s](#%s)\n", "* ", r, q | |
} |
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 | |
set -u | |
usage() { | |
cat <<EOF | |
Usage: "${BASH_SOURCE[0]##*/}" [options] [extra_file ...] |
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 | |
JQWINS=' | |
[recurse(.nodes[])] | | |
[ | |
.[] | | |
select(has("app_id")) | | |
(.id | tostring) + "\t" + .name + (" [" + if .app_id then .app_id else .shell end + "]") | |
] | |
NewerOlder