Skip to content

Instantly share code, notes, and snippets.

View mkhl's full-sized avatar
🖤
…at any cost

Martin Kühl mkhl

🖤
…at any cost
View GitHub Profile
@mkhl
mkhl / Makefile
Created August 8, 2022 18:41
my `make help` variant
.PHONY: help
help: ## Show this help
@awk -F ':.* ## ' '/^\w.*##/{printf "%-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@mkhl
mkhl / changes
Created March 11, 2022 01:00
"keep a changelog" "management" "tools"
#!/bin/sh
# Usage: changes <version> [<file>...]
# Print the changes made in <version> according to the changelog
# Defaults: <file>: CHANGELOG.md
if [ $# -eq 0 ]; then
usage "$0"
exit 64
fi
@mkhl
mkhl / nix-2.3.10.nix
Created December 5, 2021 15:03
pin nix to version 2.3
# $HOME/.config/nixpkgs/overlays/nix-2.3.10.nix
# pin nix to version 2.3
self: super:
{
nixStable = super.nix_2_3;
nix = super.nix_2_3;
nix_2_4 = super.nix_2_3;
}
@mkhl
mkhl / wait-for.sh
Last active April 23, 2021 09:57 — forked from michael-simons/wait_for_bolt.sh
A bash script waiting for port some host and port to become available without netcat or similar
#!/usr/bin/env bash
host=${1:?missing host}
port=${2:?missing port}
timeout=${3:-180}
until (exec 3<>"/dev/tcp/$host/$port") &>/dev/null; do
((timeout == 0)) && exit 1
((timeout--))
echo -n .
sleep 1
done
#!/bin/zsh
# Usage: realpath [<path>...]
# Print each real absolute <path>, resolving symlinks
# Defaults: <path>: read from stdin
case $# in
0)
while read path; do
echo "${path:A}"
done
@mkhl
mkhl / acme-editorconfig
Created April 1, 2019 20:05
EditorConfig support for Acme
#!/usr/local/plan9/bin/rc
. 9.rc
. $PLAN9/lib/acme.rc
fn convert {
awk -F'=' '
$1 == "indent_style" {
print "Spaces", ($2 == "space") ? "on" : "off"
}
@mkhl
mkhl / acme-autoformat
Last active July 19, 2023 15:52
My current autoacme event handler script
#!/usr/local/plan9/bin/rc
. 9.rc
. $PLAN9/lib/acme.rc
event=$1
target=$2
fn hashbang {
awk '
@mkhl
mkhl / README.md
Created May 16, 2018 10:35
Acme auto commands - like acmego, but generic
@mkhl
mkhl / README.md
Last active January 16, 2018 08:29

The specific profile doesn’t actually matter!

Take any dark profile (both Pastel and Tango are great!) and change the background to #292929 (the colour of the dark iTerm title bar). I also like to activate Cursor Guide and use a translucent greyish colour.

iTerm Settings

@mkhl
mkhl / README.md
Last active November 2, 2017 10:42 — forked from FND/README.md
complate-wsgi sandbox
$ python3 -m venv venv
$ . venv/bin/activate

$ pip install js2py gunicorn

$ gunicorn app:app

http://localhost:8000