Skip to content

Instantly share code, notes, and snippets.

Henry Donnay hdonnay

Block or report user

Report or block hdonnay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BUILD.nasm
name = "nasm.bin",
srcs = glob(["**/*"]),
outs = ["nasm"],
executable = True,
cmd = """
cd external/nasm
make nasm
install -vDm 0755 nasm $(@)
exec 2>/dev/null
exec sox -c 2 -n -d synth pinknoise band -n 2500 4000 tremolo 0.03 5 reverb 20 gain -l 6
hdonnay / api.go
Last active Mar 27, 2018
logger idea
View api.go
package tlog
// import (...)
func WithTags(ctx context.Context, pairs ...string) context.Context {
// turn these pairs into a bunch of [][2]string, shove into the Context
func Print(ctx context.Context, f string, v ...interface{}) {
tags := fromContext(ctx)

Keybase proof

I hereby claim:

  • I am hdonnay on github.
  • I am hdonnay ( on keybase.
  • I have a public key whose fingerprint is 5989 62F6 8B4F 9428 F27F 43D1 82E2 1E8C 09B4 BE6D

To claim this, I am signing this object:

hdonnay / work.c
Created Oct 13, 2017
work (nix-shell wrapper)
View work.c
#define _XOPEN_SOURCE 700
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
extern char **environ;
hdonnay /
Last active Jan 10, 2017
acmetool tls-sni hook
# Provided in the public domain.
# This works best as a suid hook.
# nginx may complain about the server_name being too long. Either fix it, or
# the commented out pattern should work.
hdonnay / gdb
Created Oct 12, 2016
gdbserver work
View gdb
% gdb amd64/bin/cat
GNU gdb (GDB; openSUSE Tumbleweed) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
View diff.go
// This is something like n^2 worst-case.
// []string must be sorted
func diffStrings(new, old []string) (added, removed []string) {
for _, x := range new {
for _, y := range old {
if x == y {
continue Add
hdonnay /
Last active Dec 18, 2015
Helper script to use esky with salt
trap '[ -f patch.$$ ] && patch -R < patch.$$' 0
set -e
#exec >/dev/null
[ -f ] || { printf "You seem to be in the wrong directory.\n"} >&2; exit 1; }
if ! which patchelf >/dev/null 2>&1; then
printf "Couldn't find 'patchelf', going to download and compile.\n" >&2
git clone
hdonnay /
Last active Dec 14, 2015
ht, a hashtable in sh
usage() {
cat >&2 <<EOF
$(basename $0) -- $VERSION
$(basename $0) [-r] [-d dir] { -o | [-v] KEY }
If stdin is attached, it will be inserted into key KEY. If it's not,
You can’t perform that action at this time.