Skip to content

Instantly share code, notes, and snippets.

Nick Glynn 17twenty

Block or report user

Report or block 17twenty

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
@17twenty
17twenty / exportstats.go
Last active Sep 10, 2019
Simple example of using expvar to instrument Golang apps.
View exportstats.go
package exportstats
import (
"expvar"
"fmt"
"runtime"
)
var stats *expvar.Map
@17twenty
17twenty / gist:2fb30a22141d84e52446
Created Feb 22, 2016
POST with NewRequest using Golang
View gist:2fb30a22141d84e52446
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
@17twenty
17twenty / crazyOlSelectCase.go
Last active Aug 10, 2019
Using reflect.SelectCase - an example
View crazyOlSelectCase.go
package main
import (
"log"
"reflect"
"time"
)
func main() {
c1 := make(chan int)
@17twenty
17twenty / simple_git.md
Created Sep 27, 2013
A Simple Git branching model
View simple_git.md

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

The gist

@17twenty
17twenty / WorkingRemote.md
Created Jul 24, 2019
Top tips for working remotely
View WorkingRemote.md

Be as available as possible This is probably the best piece of advice I received from a friend prior to starting my new job. Things move quickly back at the home office, and since you’re not there, there’s a built-in delay for someone wishing to communicate with you.

If it always takes hours for someone to get your ear for just a minute, you’ll build a reputation as someone who’s “never around”–even if only subconsciously–among your coworkers.

As a remote employee, you have to work harder at being available to avoid the impression that you’re never available.

Strive to build a reputation as someone who is quick to respond. Be eager to hear the latest developments on projects so that you’re never out of sync with everyone else in your office.

@17twenty
17twenty / readme.md
Created Jul 22, 2019
Using golang-migrate AKA mattes/migrate with Docker, Postgres and creating new schemas.
View readme.md

Using golang-migrate AKA mattes/migrate with Docker, Postgres and creating new schemas.

Prerequisites

We use the golang-migrate tool (formerly known as mattes/migrate) - build it with postgres support.

$ go get -v -u -tags 'postgres' github.com/golang-migrate/migrate/cli
$ migrate -h
Usage: migrate OPTIONS COMMAND [arg...]
@17twenty
17twenty / xForwardTest.go
Created Jan 18, 2017
Extracting X-Forwarded-For from connections in Golang
View xForwardTest.go
package main
import (
"fmt"
"log"
"net/http"
"strings"
)
func main() {
@17twenty
17twenty / .bash_profile
Last active May 20, 2019
Mac bash profile to add Git, nice prompt and ls colours, bash completion (requires brew install bash-completion)
View .bash_profile
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
fi
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
@17twenty
17twenty / Makefile
Created Aug 22, 2013
Simple Misc Driver Example
View Makefile
# Simple Makefile to build a simple misc driver
# Nick Glynn <Nick.Glynn@feabhas.com>
#
obj-m += misc_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
CC := $(CROSS_COMPILE)gcc
You can’t perform that action at this time.