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
#!/usr/bin/env python | |
from __future__ import print_function | |
try: | |
import mock | |
except ImportError: | |
from unittest import mock | |
import unittest |
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
-- based on https://news.ycombinator.com/item?id=9018756 | |
=# select *, 'foo'::text into test from generate_series(1,5) as id; | |
SELECT 5 | |
Time: 77.975 ms | |
=# select * from test; | |
┌────┬──────┐ | |
│ id │ text │ | |
├────┼──────┤ | |
│ 1 │ foo │ | |
│ 2 │ foo │ |
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
#!/usr/bin/env python | |
from io import StringIO | |
import argparse | |
import sys | |
import unittest | |
def quote_list(r, sep=None): | |
# hope r is smallish |
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
#!/usr/bin/env python | |
import argparse | |
import os | |
import subprocess | |
import sys | |
def rebase(base, branch, abort=True): | |
try: |
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
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 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
#!/usr/bin/env python | |
import importlib | |
import sys | |
def actions(module): | |
mod = importlib.import_module(module) | |
for attrib in dir(mod): |
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 ( | |
"log" | |
"net/http" | |
"time" | |
) | |
// https://raw.githubusercontent.com/zenazn/goji/master/web/middleware/nocache.go |
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 | |
gotest() { | |
clear | |
go test -bench . | |
} | |
gotest | |
export -f gotest | |
fswatch -o *go | xargs -t -I{} bash -c gotest |
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
#!/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 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 -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 \ |