Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Peterson captncraig

  • Grafana Labs
  • Brooklyn
  • 03:46 (UTC -05:00)
  • Twitter @captncraig
View GitHub Profile
@captncraig
captncraig / 1
Last active July 28, 2021 01:37
blueprints
View 1
BLUEPRINT:0,11,1104,0,0,0,0,0,637629469942961215,0.8.19.7715,Jumpstart%20%231%20-%20Copper%20Ingots,"H4sIAAAAAAAAC41XW0wcVRg+s2xhC4XSYrHQCwVaoFyKBUrZlnZnu4AuUKE2xliaiompL8bQaKJpQsBLlu0b3hK2L6waa601NqGXvbQBkmo3+qLWRBIfaNTU+lSMD1YpO57/nDlz/sIf7CYz58uE7/uv8/8DY4zl88vF5K+UXytsbDCLsZT9eAU7bD9mC9akGWbDpjFw/ArGlhUKwPV9Vjk7wP/O4j8DZBw98bvlP2UTMMZkF0G2HZzxC2stN688iEcCcAHZTZAz5HEHWcZYkw2C7JbHd4igscGJhk3OJMh2LueQqxpPpEMBuICcQZAz5ZFC5BQZcxZBzpLHFHJ7isy2hyB75BFD5BiZsH0EeaWKeaXBnJg1lr+0Z78gwg8XKVs1SeHX4RZjtGg3xgvc5QXb7RzCco5qEk3GWLudS5BXqSbRBI1xnbMJcq5qkteDoRZjqugyxmnuctp2ezVBzlMJEwSRYY1xqVYRZBDkD2841jDGbq8hyPnyuIfc1hhnO48gr1EdphOmMY55LUFeqzpMx4yxLlUrQS6wzwPabY1xwvIJ8iOy2eb8cE5HAgnI9se+074Tx+uSsztT8ditDS0/Z20XfQxxZ1lyFIIGqKxT5Wr/pcE8UbEj+b51V7wcbzTeiL/UfGzifHoiAALw8oOIZSjrEhSqNtUvxcxDvyCPKnInWOcuuzmu5tanI8HE4dGTTc8bGV6w7rItgXULWV+vBHT8M078XyU9e64e2SjiB3KOih8JFKm6Cw8qapIujmuFBx2Jqjp/U8Hg2GUQgBFUTHhQrATyIGa7cTRePv4NcLtvTfrPVZY0T0f2JYD8BbjPPck7utvbd0m6X2y36GL3NzJR1zuOy/Cen3dfN0/czk9mrJ+Mvbog6w+WhU1Uf0jqJiYym0ICKf9nQqAgubv+E29
@captncraig
captncraig / keybase.md
Created February 5, 2016 22:38
keybase.md
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

View install.sh
apt-get update
apt-get install -y curl git mercurial make binutils bison gcc build-essential
git clone https://go.googlesource.com/go go14
git clone go14 go15
git clone go14 go16
#build all go versions
cd go14/src
@captncraig
captncraig / read.go
Created August 26, 2015 23:21
ReadUntilRegex
View read.go
func ReadUntilRegex(r io.Reader, regex string) (string, error) {
accumulated := []byte{}
reg, err := regexp.Compile(regex)
if err != nil {
return "", nil
}
for {
buf := make([]byte, 16*1024)
n, err := r.Read(buf)
if err != nil && err != io.EOF {
@captncraig
captncraig / main.go
Created April 21, 2015 22:51
Slack auto inviter
View main.go
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@captncraig
captncraig / BarService.after.go
Last active August 29, 2015 14:13
Thrift Go Generator Changes
View BarService.after.go
type BarServiceProcessor struct {
*FooServiceProcessor
handler BarService
}
func (p *BarServiceProcessor) runProcessorFunction(key string, seqId int32, iprot, oprot thrift.TProtocol) (found, ok bool, err thrift.TException) {
switch key {
case "ping":
ok, err = p.Process_Ping(seqId, iprot, oprot)
return true, ok, err
@captncraig
captncraig / create table
Created September 22, 2014 17:29
Sql Panic
View create table
CREATE TABLE [dbo].[Foobar](
[Foo] [int] NULL
) ON [PRIMARY]
GO
View gist:8643cd9c740fcb691a52
package objectPrinter
import (
"fmt"
"reflect"
)
func DeconstructThing(value interface{}, prefix string, m map[string]interface{}, depth int) {
key := prefix
//key will be used for all leaf nodes