Skip to content

Instantly share code, notes, and snippets.

Avatar
🖤
…at any cost

Martin Kühl mkhl

🖤
…at any cost
View GitHub Profile
@mkhl
mkhl / wait_for_bolt.sh
Created Jun 26, 2020 — forked from michael-simons/wait_for_bolt.sh
A bash script waiting for port 7687 to become available without netcat or similar.
View wait_for_bolt.sh
#!/bin/bash
until (exec 3<>/dev/tcp/127.0.0.1/7687) &>/dev/null; do
echo -n .
sleep 1
done
View realpath
#!/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 Apr 1, 2019
EditorConfig support for Acme
View acme-editorconfig
#!/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 Apr 5, 2020
My current autoacme event handler script
View acme-autoformat
#!/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
Acme auto commands - like acmego, but generic
View README.md
View README.md

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 Nov 2, 2017 — forked from FND/README.md
complate-wsgi sandbox
View README.md
$ python3 -m venv venv
$ . venv/bin/activate

$ pip install js2py gunicorn

$ gunicorn app:app

http://localhost:8000

@mkhl
mkhl / README.md
Created Nov 2, 2017
Tail-recursive Tree fold using CPS
View README.md

Tail-recursive Tree fold

Both the original and the proposed solution assume an associative and commutative combining function (g).

That bugged me so a colleague and I put this together.

View keybase.md

Keybase proof

I hereby claim:

  • I am mkhl on github.
  • I am mkhl (https://keybase.io/mkhl) on keybase.
  • I have a public key ASDOZDDY2WKJiu0GMeVXecOv_KalOkFnJhahWX-vYhWcAAo

To claim this, I am signing this object:

View snippets.cson
# Demonstration for https://github.com/atom/text-document/issues/15
# Expand this snippet, type "foo" for the first placeholder, hit <Tab>
'.text.plain':
'Test: Adjacent Tabstops':
'prefix': 'a'
'body': '${1:abc}${2:def}'