Skip to content

Instantly share code, notes, and snippets.

from textwrap import dedent
BILLS = dedent("""
50 padding
32.00 O2
100.00 charities
15.00 medicines, supplements
5 Monzo Plus
@norm
norm / gist:1bce793b20c6f31f871cad330a35be91
Last active June 27, 2022 13:05
patch to cdparanoia
diff --git a/main.c b/main.c
index 5c4b701..20adfd5 100644
--- a/main.c
+++ b/main.c
@@ -384,7 +384,7 @@ static void callback(long inpos, int function){
static int slast=0;
static int stimeout=0;
static int cacheerr=0;
- char *smilie="= :-)";
+ char *smilie=":-)";
@norm
norm / gist:a36e90a2e5877947ba9c11a429a94a63
Created December 5, 2021 14:07
adding GIF details to existing GIFs
files=($(find source -name \*.toml))
for file in "${files[@]}"; do
gif=$(echo $file | sed -e 's/toml$/gif/')
if ! grep -q info.filesize $file; then
echo "++ $file"
sed -i '' -e 's/^"""/"""\n\ninfo.colours = ""\ninfo.filesize = ""\ninfo.frames = ""\ninfo.size = ""\ninfo.time = ""/' $file
./script/gif_info $gif $file
fi
done
@norm
norm / keybase.md
Created November 9, 2018 12:46
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@norm
norm / Hawaiian chocolate haupia pie
Last active August 9, 2018 05:22
Hawaiian chocolate haupia pie
A great dessert if you are a fan of coconut.
@norm
norm / codename.sh
Last active June 1, 2018 10:52
heroku-style codenames
#!/bin/bash
adjectives=(
aged autumn
billowing bitter black blue bold broken
cold cool crimson
damp dark dawn delicate divine dry
empty
falling floral fragrant frosty
green
@norm
norm / tf
Created May 4, 2018 14:04
tf — terraform wrapper script
#!/bin/bash
set -e -o pipefail
case "$1" in
plan)
terraform plan -out planfile
;;
apply)

Software I use

Enforced keyboard breaks

First things first — I've had RSI and incessant pain before, and I don't want it again. There are many instances of keyboard break software, but the one I use is AntiRSI. It's available from the Mac App Store for a fiver, and its worth every penny to me. If you prefer free, an older version is still available. I enforce it always being running (but with the ability to turn it off when playing games) with a script I run from cron.

Controlling my computer

I use LaunchBar for more things than I can count. A Mac just doesn't seem to work right until I've got LaunchBar working.

@norm
norm / df.sh
Last active September 11, 2016 06:37
A more concise `df` command
#!/bin/sh
/bin/df -h "$@" 2>/dev/null | perl -e '
$prefix = <>;
$longest_fs = 20;
while ( <> ) {
m{
^
( [\S+\s]+? ) \s+ # Filesystem
@norm
norm / README.markdown
Last active December 14, 2016 03:19
Get reminders of available updates for software on your Mac from the Mac App Store.

appupdates-notify

Get reminders of available updates for software on your Mac from the Mac App Store.

Install the pre-requisites:

brew install mas terminal-notifier

Copy to your computer: