This file contains 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
FROM ubuntu:16.04 | |
# based on http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/ | |
RUN apt-get update && apt-get install -y firefox | |
RUN useradd -u 501 -m developer | |
USER developer | |
ENV HOME /home/developer | |
CMD /usr/bin/firefox |
This file contains 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
#!/usr/bin/env python | |
import importlib | |
import sys | |
def actions(module): | |
mod = importlib.import_module(module) | |
for attrib in dir(mod): |
This file contains 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 ( | |
"log" | |
"net/http" | |
"time" | |
) | |
// https://raw.githubusercontent.com/zenazn/goji/master/web/middleware/nocache.go |
This file contains 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 | |
gotest() { | |
clear | |
go test -bench . | |
} | |
gotest | |
export -f gotest | |
fswatch -o *go | xargs -t -I{} bash -c gotest |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw | |
LjE0OTAxOTYwNzggMC40OTQxMTc2NDcxIDAuOTEzNzI1NDkwMgAQAYAC0hAREhNaJGNs | |
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp |
This file contains 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 -e | |
if [ ! -d ${GOPATH} ]; then | |
echo missing GOPATH | |
exit 1 | |
fi | |
mv ${GOPATH} ${GOPATH}.$(date '+%Y%m%d_%H%M%S') | |
mkdir -p ${GOPATH} | |
go get -u -v \ |
This file contains 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
#!/usr/bin/env python | |
"""Export environment variables for AWS cli w/MFA. | |
eval $(aws-session-env.py $1) | |
""" | |
import argparse | |
import os | |
import boto3 |
This file contains 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
if somaxconn, err := unix.Sysctl("kern.ipc.somaxconn"); err != nil { | |
panic(err) | |
} else { | |
var backlog uint16 | |
r := strings.NewReader(somaxconn) | |
if err := binary.Read(r, binary.LittleEndian, &backlog); err != nil { | |
fmt.Println("binary.Read failed:", err) | |
} | |
fmt.Println(backlog) | |
} |
This file contains 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
# Gopkg.toml example | |
# | |
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | |
# for detailed Gopkg.toml documentation. | |
# | |
# required = ["github.com/user/thing/cmd/thing"] | |
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | |
# | |
# [[constraint]] | |
# name = "github.com/user/project" |
This file contains 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 ( | |
"bytes" | |
"encoding/json" | |
"testing" | |
) | |
var ( | |
data map[string]interface{} |