Skip to content

Instantly share code, notes, and snippets.

Andrew Gerrand adg

View GitHub Profile
View gist:9cff49420906f4d825efc24e2f4e412d
$ go test ./...
ok github.com/dgraph-io/dgraph/algo 0.175s
[Decoder]: Using assembly version of decoder
2019/10/11 07:04:48 rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp [::1]:9180: connect: connection refused"
FAIL github.com/dgraph-io/dgraph/chunker 1.332s
ok github.com/dgraph-io/dgraph/codec 34.952s
? github.com/dgraph-io/dgraph/codec/benchmark [no test files]
? github.com/dgraph-io/dgraph/compose [no test files]
ok github.com/dgraph-io/dgraph/conn 1.249s
? github.com/dgraph-io/dgraph/contrib/embargo [no test files]
View gist:403300a7330d72ae366540b8dd3aad5f
~/src/upspin.io $ time go test -short ./...
ok upspin.io/access 0.052s
ok upspin.io/bind 0.211s
ok upspin.io/cache 0.028s
ok upspin.io/client 1.076s
ok upspin.io/client/clientutil 0.079s
ok upspin.io/client/file 0.056s
? upspin.io/cloud/https [no test files]
? upspin.io/cloud/mail [no test files]
ok upspin.io/cloud/mail/sendgrid 0.069s
@adg
adg / upspinserver-update.sh
Last active Jul 15, 2018
Update upspinservers to expose port 80
View upspinserver-update.sh
#!/bin/bash -e
# This script configures upspinservers deployed by upspin-ui to expose both
# port 80 and 443, to enable the Let's Encrypt http-01 challenge mechanism.
# See https://github.com/upspin/upspin/issues/568 for more details.
PROJECT="$1"
if [[ "$#" != "1" || "$PROJECT" == "" ]]; then
echo >&2 "usage: $0 <google-cloud-project-id>"
exit 2
@adg
adg / decode.go
Created May 23, 2017
decode webcam
View decode.go
package main
import (
"fmt"
"image/jpeg"
"io"
"log"
"mime/multipart"
"os/exec"
View gist:5fd928cacbc9c3e0249aa4ddc4d96aed
$ go test -short ./...
ok upspin.io/access 0.088s
ok upspin.io/bind 0.724s
ok upspin.io/cache 0.025s
ok upspin.io/client 2.011s
ok upspin.io/client/clientutil 0.162s
ok upspin.io/client/file 0.055s
? upspin.io/cloud/https [no test files]
? upspin.io/cloud/log [no test files]
? upspin.io/cloud/mail [no test files]
@adg
adg / hlint.sh
Created Aug 27, 2015
hlint - a linter for HTML
View hlint.sh
#!/bin/sh
file=${1:-$GOROOT/doc/go_spec.html}
tidy -utf8 -q -e $file 2>&1 | sed 's;line \([0-9][0-9]*\) column [0-9][0-9]* - ;'$file':\1: ;' | egrep -v 'missing <!DOCTYPE> declaration|inserting missing .title. element'
View ex_test.go
package ex_test
import "fmt"
func ExampleTestExample() {
fmt.Println(` flags.Bool("debug", false, "Turn on debugging.")`)
fmt.Println(` viper.BindPFlag("debug", flags.Lookup("debug"))`)
// Output:
// flags.Bool("debug", false, "Turn on debugging.")
// viper.BindPFlag("debug", flags.Lookup("debug"))
View fosdem2015-go-lightning-talks.md

Go Lightning Talks

3:30pm, 1 Feb 2015, Go DevRoom, FOSDEM, Room K.3.401

Camlistore demo

Mathieu Lonjaret https://twitter.com/lejatorn

Live demo of Camlistore easy deployment on gce. Quick overview of Camlistore's UI & tools.

@adg
adg / keep.txt
Created Jan 19, 2015
go-lite file list
View keep.txt
These files should be kept.
go/AUTHORS
go/CONTRIBUTORS
go/LICENSE
go/PATENTS
go/README
go/VERSION
go/bin/go
go/include/README
You can’t perform that action at this time.