Skip to content

Instantly share code, notes, and snippets.

#!/bin/ksh
set -eu
typeset -A tracked
export SUBDIRECTORY_OK=1 NONGIT_OK=0 OPTIONS_SPEC='' LONG_USAGE='' USAGE='' GIT_TEXTDOMAINDIR='' GIT_GETTEXT_POISON=''
export GIT_TEST_GETTEXT_POISON=''
source "$(git --exec-path)/git-sh-setup"
@gwatt
gwatt / wait.go
Created January 22, 2016 15:42
wait for all channels to receive a value
package wait
import (
"fmt"
"reflect"
)
type ReadChan struct {
Var interface{}
Chan interface{}
@gwatt
gwatt / sqlscan.go
Last active August 29, 2015 14:23
Easy Struct scanning from SQL.
import (
"database/sql"
"reflect"
)
/*
* You can pass in an unaltered pointer to sql.Row, sql.Rows as a "RowScanner"
*/
type RowScanner interface {
Scan(dest ...interface{}) error