This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step #1 setup cross compiler(s) you want/need to use | |
cd $(go env GOROOT)/src | |
GOOS=linux GOARCH=amd64 ./make.bash <- GOOS=operating system - linux, darwin, windows etc... GOARCH=architechture - amd64, x86_64 386... | |
Step #2 navigate to go project | |
cd /path/of/go/project | |
env GOOS=linux GOARCH=amd64 go build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key := securecookie.GenerateRandomKey(64) | |
encoded := base64.StdEncoding.EncodeToString(key) | |
decoded, _ := base64.StdEncoding.DecodeString(encoded) | |
log.Println(key) | |
log.Println(encoded) | |
log.Println(decoded) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LogResponseWritter wraps the standard http.ResponseWritter allowing for more | |
// verbose logging | |
type LogResponseWritter struct { | |
status int | |
size int | |
http.ResponseWriter | |
} | |
// func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter { | |
// // Default the status code to 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pool holds Clients. | |
type Pool struct { | |
pool chan *Client | |
} | |
// NewPool creates a new pool of Clients. | |
func NewPool(max int) *Pool { | |
return &Pool{ | |
pool: make(chan *Client, max), | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"auto_complete_commit_on_tab": true, | |
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme", | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { "GOPATH":"$GOPATH"}, | |
"fmt_cmd": ["goimports"], | |
"on_save": [{ | |
"cmd": "gs9o_open", "args": { | |
"run": ["sh", | |
"gofmt -s -w . && go build . errors && go test -i && go test && go vet && golint ."], | |
"focus_view": false | |
}}], | |
"autocomplete_closures": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CD_CMD="cd "\\\"$(pwd)\\\"" && clear" | |
if echo "$SHELL" | grep -E "/fish$" &> /dev/null; then | |
CD_CMD="cd "\\\"$(pwd)\\\""; and clear" | |
fi | |
VERSION=$(sw_vers -productVersion) | |
OPEN_IN_TAB=0 | |
while [ "$1" != "" ]; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package iris | |
import ( | |
"io" | |
"net/http" | |
_ "runtime" | |
"testing" | |
"github.com/gin-gonic/gin" | |
"github.com/go-playground/lars" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package client | |
import ( | |
"net/rpc" | |
"github.com/go-playground/log" | |
) | |
// NewFunc is the type of function that is called to create a new Go rpc Client | |
type NewFunc func() *rpc.Client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
twitter "github.com/ChimeraCoder/anaconda" | |
"gopkg.in/go-playground/webhooks.v3" | |
"gopkg.in/go-playground/webhooks.v3/github" |
OlderNewer