Skip to content

Instantly share code, notes, and snippets.

@koutoftimer
koutoftimer / die.sh
Created March 27, 2024 13:42 — forked from alexanderankin/die.sh
Bash Die Function
function die () {
local message=$1
[ -z "$message" ] && message="Died"
echo "$message (at ${BASH_SOURCE[1]}:${FUNCNAME[1]} line ${BASH_LINENO[0]}.)" >&2
exit 1
}
@koutoftimer
koutoftimer / Makefile
Last active February 8, 2026 07:43
Minimal templating in C
run: a.out
./a.out
ctrans: ctrans.c
gcc ctrans.c -o ctrans
index.h: index.template.h ctrans
./ctrans index.template.h > index.h
a.out: index.h