Skip to content

Instantly share code, notes, and snippets.

View pkieltyka's full-sized avatar
🇨🇦
hi

Peter Kieltyka pkieltyka

🇨🇦
hi
View GitHub Profile
Transport = &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: reqTimeout,
KeepAlive: 60 * time.Second,
}).Dial,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSHandshakeTimeout: 5 * time.Second,
MaxIdleConnsPerHost: 2,
DisableCompression: true,
type MediaType int
const (
MediaUnknown MediaType = iota
MediaImage
MediaVideo
MediaAudio
MediaDocument
MediaPresslyComment
)
@pkieltyka
pkieltyka / gist:505b07b09f5c63e36ef5
Last active November 6, 2015 20:26
github.com/pressly/chi benchmarks
Based on: https://github.com/pkieltyka/go-http-routing-benchmark
$ go test -v -bench="HttpRouter|Chi|Goji|Macaron|Martini|Gorilla|Gocraft|Beego" .
#GithubAPI Routes: 203
Beego: 167624 Bytes
Chi: 70728 Bytes
GocraftWeb: 89080 Bytes
Goji: 88392 Bytes
GorillaMux: 1496624 Bytes
@pkieltyka
pkieltyka / zshrc
Last active October 1, 2015 18:04
/etc/zshrc
# Correctly display UTF-8 with combining characters.
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
setopt combiningchars
fi
# pk
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
export EDITOR=vim
// Example server that embeds gnatsd
package main
import (
"log"
"net/http"
"syscall"
"github.com/nats-io/gnatsd"
"github.com/nats-io/nats"
.PHONY: help run test build dist clean tools dist-tools deps update-deps vendor
all:
@echo "make <cmd>"
@echo ""
@echo "commands:"
@echo " run - run in dev mode"
@echo " test - run go tests"
@echo " build - build binaries into bin/ directory"
@echo " clean - clean up bin/ directory"
ubuntu@52.20.188.27:22 | INFO[2015-09-11T16:16:31Z] Recording err reflect: call of reflect.Value.FieldByName on zero Value
ubuntu@52.20.188.27:22 | INFO[2015-09-11T16:16:31Z] [6df22026587d/p56Y8kSkFN-000632] panic: reflect: call of reflect.Value.FieldByName on zero Value
ubuntu@52.20.188.27:22 | /go/src/github.com/zenazn/goji/web/middleware/recoverer.go:24 (0x5d266a)
ubuntu@52.20.188.27:22 | /usr/local/go/src/runtime/asm_amd64.s:437 (0x459e4e)
ubuntu@52.20.188.27:22 | /usr/local/go/src/runtime/panic.go:423 (0x429e19)
ubuntu@52.20.188.27:22 | /go/src/github.com/tobi/airbrake-go/airbrake.go:228 (0x5ce6e3)
ubuntu@52.20.188.27:22 | /usr/local/go/src/runtime/asm_amd64.s:437 (0x459e4e)
ubuntu@52.20.188.27:22 | /usr/local/go/src/runtime/panic.go:423 (0x429e19)
ubuntu@52.20.188.27:22 | /usr/local/go/src/reflect/value.go:199 (0x5fe6a6)
ubuntu@52.20.188.27:22 | /usr/local/go/src/reflect/value.go:788 (0x6018c3)
testing the stream..
github.com/pkieltyka/projectX
github.com/BurntSushi/toml 056c9bc7be7190eaa7715723883caffa5f8fa3e4
github.com/PuerkitoBio/purell d69616f51cdfcd7514d6a380847a152dfc2a749d
github.com/garyburd/redigo 9d4db5d1dbeff473d50e1bb82f5405c8cca0f0ac
github.com/gographics/imagick 8172534433e0832b1235218fbadf2593226111bd
github.com/golang/snappy 723cc1e459b8eea2dea4583200fd60757d40097a
github.com/goware/urlx 0c5b5e0d84d824b141166ed64e8c88e24753c37f
github.com/mitchellh/goamz caaaea8b30ee15616494ee68abd5d8ebbbef05cf
github.com/op/go-logging e8d5414f0947014548c2334044a0fac13187dfee
github.com/opennota/urlesc 5fa9ff0392746aeae1c4b37fcc42c65afa7a9587
FROM golang:1.5rc1
MAINTAINER Derek Collison <derek@apcera.com>
ADD . /go/src/github.com/nats-io/gnatsd
WORKDIR /go/src/github.com/nats-io/gnatsd
RUN go get ./...
RUN CGO_ENABLED=0 go install -v -a -tags netgo -installsuffix netgo -ldflags "-s -w -X github.com/nats-io/gnatsd/version.GITCOMMIT `git rev-parse --short HEAD`"