Skip to content

Instantly share code, notes, and snippets.

View lorenzleutgeb's full-sized avatar

Lorenz Leutgeb lorenzleutgeb

View GitHub Profile
@lorenzleutgeb
lorenzleutgeb / rad-worktree.sh
Last active May 7, 2024 19:32
rad-worktree
#! /bin/sh
set -eu
jq -V >/dev/null
if [ $# -lt 1 ]
then
printf 'Usage: %s rad:… [name-of-worktree]\n' "$0"
printf 'The worktree will be created in a new directory within the current working directory.'
exit 1
@lorenzleutgeb
lorenzleutgeb / rad-alternate.sh
Last active May 7, 2024 14:14
rad-alternate
#! /bin/sh
set -eu
REMOTE="rad"
ALTERNATES="$(git rev-parse --absolute-git-dir)/objects/info/alternates"
URI=$(git remote get-url "$REMOTE")
if [ "${URI:0:6}" != "rad://" ]
then
echo "URL for remote '$REMOTE' does not have expected prefix 'rad://'. Aborting."
@lorenzleutgeb
lorenzleutgeb / rad-wire.sh
Last active May 7, 2024 14:15
rad-wire
#! /bin/sh
set -eu
JQ="jq --unbuffered --color-output"
JQ_TX="JQ_COLORS='1;30:0;39:0;39:0;39:1;35:1;39:1;39:1;31' $JQ | sed 's/^/>/'"
JQ_RX="JQ_COLORS='0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34' $JQ | sed 's/^/</'"
SOCKET="${RAD_HOME:-"${HOME}/.radicle"}/node/control.sock"
if [ ! -S "${SOCKET}" ]
@lorenzleutgeb
lorenzleutgeb / README.md
Created April 5, 2024 15:54
Redirection settings for the NixOS Wiki
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash gh curl jq
set -euo pipefail
REV="main" # 2c50fffdcecb245836ed02cb5c2480a57bdcfef7 as of 2024-03-18
URL_BASE="https://github.com/starknet-io/provisions-data/raw/${REV}/github"
if [ $# == 1 ]
then # use GitHub username passed via commandline argument.
LOGIN=$1
@lorenzleutgeb
lorenzleutgeb / committer-progress.sh
Last active July 9, 2024 14:13
Nixpkgs Committer Progress
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash gh
set -eu
# See <https://gist.github.com/lorenzleutgeb/239214f1d60b1cf8c79e7b0dc0483deb>.
# Will exit non-zero if not logged in.
gh auth status
if [ $# == 1 ]
@lorenzleutgeb
lorenzleutgeb / accepted.txt
Last active May 18, 2023 14:56
Find LaTeX packages not accepted by TAPS
abstract
acronym
algorithm
algorithm2e
algorithmic
alltt
amsbsy
amscd
amsfonts
amsgen
:: The first argument is always "-C", since
:: External Editor Revived thinks that this
:: process is bash.
set target=%2
:: The following two lines can be used to
:: convert the argument to a WSL path.
::set target=%target:\\=/%
::set target=%target:C:=/mnt/c%
@lorenzleutgeb
lorenzleutgeb / keybase.md
Created December 8, 2020 10:11
Keybase proof

Keybase proof

I hereby claim:

  • I am lorenzleutgeb on github.
  • I am lorenzleutgeb (https://keybase.io/lorenzleutgeb) on keybase.
  • I have a public key ASD6u6iP7MRx35wMg8Im2meDT587dnMpsNou19T6RTpJrQo

To claim this, I am signing this object:

@lorenzleutgeb
lorenzleutgeb / 3col.lp
Created January 31, 2018 20:19
Graph 3-Coloring with ASP
% Instance format:
% v/1 for vertices.
% e/2 for edges.
% Example:
% v(1..4).
% e(1,2).
% e(1,3).
% e(3,4).