Skip to content

Instantly share code, notes, and snippets.

@partkyle
partkyle / Dockerfile
Created September 8, 2015 16:54
Run httpbin in a docker container.
FROM python:2.7
RUN pip install httpbin gunicorn
CMD ["gunicorn", "httpbin:app", "-b", "0.0.0.0:80"]
@partkyle
partkyle / deliver.go
Last active August 29, 2015 14:16
Example of versioned dependency issue
package deliver
import message "message/v1"
func Deliver(m message.Message) {
// do something here
}
@partkyle
partkyle / my_test.go
Created December 10, 2014 19:22
golang setup closure example
package main_test
import (
"net/http/httptest"
"testing"
"time"
)
type Bag struct {
Holding int
@partkyle
partkyle / harness_style_test.go
Last active August 29, 2015 14:11
setup / teardown pattern in Go tests
package main_test
import (
"net/http/httptest"
"testing"
)
type testHarness struct {
server *httptest.Server
}
@partkyle
partkyle / completion_test.go
Created December 10, 2014 18:38
GoSublime Completion Bug
package main_test
import (
"fmt"
"testing"
)
import . "github.com/onsi/ginkgo"
type Value struct {
@partkyle
partkyle / curses.go
Created December 2, 2014 17:51
Single Progress line cursor
package main
import (
"fmt"
"strings"
"time"
)
func main() {
for i := 1; i <= 100; i++ {
@partkyle
partkyle / udp_fail.go
Created October 13, 2014 22:35
UDP is failing when the remote address goes down.
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net"
)
@partkyle
partkyle / smtp.go
Last active August 29, 2015 14:01
smtp server idea using channels as the control flow.
package main
import (
"flag"
"net"
"github.com/partkyle/smtpd"
)
var (
var margin = 15;
S.cfga({
"defaultToCurrentScreen" : true,
"secondsBetweenRepeat" : 0.1,
"checkDefaultsOnLoad" : true,
"focusCheckWidthMax" : 3000
});
// Create Operations
@partkyle
partkyle / gotta-golang-them-all.md
Last active August 29, 2015 13:57
Use all Golang Packages!