Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am smcquay on github.
  • I am smcquay (https://keybase.io/smcquay) on keybase.
  • I have a public key ASCU0DIq59Is0to523zrSCU9bNRu_c8qMmi1XpvCtGAAKwo

To claim this, I am signing this object:

Apr 23 14:38:24 impa.local unknown[26525]: done
Apr 23 14:38:24 impa.local cat[26527]: done
Apr 23 14:38:24 impa.local cat[26529]: done
Apr 23 14:38:24 impa.local cat[26531]: done
Apr 23 14:38:24 impa.local unknown[26533]: done
Apr 23 14:38:24 impa.local cat[26535]: done
Apr 23 14:38:24 impa.local cat[26537]: done
Apr 23 14:38:24 impa.local cat[26539]: done
Apr 23 14:38:24 impa.local unknown[26541]: done
smcquay@smm:/var/folders/xd/_7spxpr106ncgw60_y2m_7bc0000gn/T/tmp.BBU5HH5X
⌘ go get mcquay.me/bps rc: 128
smcquay@smm:/var/folders/xd/_7spxpr106ncgw60_y2m_7bc0000gn/T/tmp.BBU5HH5X
⌘ find .
.
./pkg
./pkg/darwin_amd64
./pkg/darwin_amd64/mcquay.me
./pkg/darwin_amd64/mcquay.me/bps.a
./src
var hello = "yep";
etcdctl rm -r /traefik
echo -n "tmp" | etcdctl set /traefik/frontends/fe1/backend
echo -n "Host:impa.local" | etcdctl set /traefik/frontends/fe1/routes/test_1/rule
echo -n "http" | etcdctl set /traefik/frontends/fe1/entrypoints
echo -n "http://impa.local:8000" | etcdctl set /traefik/backends/tmp/servers/server1/url
echo -n "1" | etcdctl set /traefik/backends/tmp/servers/server1/weight
def bar(args):
return len(args) * 20
### Keybase proof
I hereby claim:
* I am smcquay on github.
* I am smcquay (https://keybase.io/smcquay) on keybase.
* I have a public key whose fingerprint is 567B 819E 7190 3026 863A CAA2 4E4B 72F4 79BA 3CE5
To claim this, I am signing this object:
#!/bin/bash
cmd -option -option -option &
cmd_pid=$!
wait $cmd_pid
@smcquay
smcquay / proposal.md
Last active December 28, 2015 18:09
gophercon proposal

Writing and Debugging a Web-Based Multi-Player Game

We have recently been working on a game called hackerbots whose server-side component we chose to author in go. We learned quite a few lessons about how to write server-side code in go along the way. A few of the things we will discuss include:

- how to test for (and solve) leaking go routines
- how to use the profiler to uncover issues with your code
- mixing websockets and http for game play and game control
- go concepts that help us separate game state, player updates, and network traffic
- optimizing JSON serialization for minimal traffic while maintaining human readability
  • how go got in our way, and what we did to make it less painful
@smcquay
smcquay / doubleserve.go
Created November 7, 2013 08:09
This is an example of how to serve both a normal collection of routes and net/http/pprof on distinct addr:port in golang
package main
import (
jsonh "bitbucket.org/smcquay/json"
"encoding/json"
"fmt"
"log"
"net/http"
_ "net/http/pprof"
)