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 | |
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt | |
echo 01 > ca.srl | |
openssl genrsa -des3 -out ca-key.pem | |
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem | |
openssl genrsa -des3 -out server-key.pem | |
openssl req -new -key server-key.pem -out server.csr |
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 zsh | |
# aspires to be git stash, everywhere (temporarily hide and unhide files/dirs) | |
# achieves less: hides a single file or directory by prefixing it with ".stashed-" | |
# (i.e., will not stash multiple files in the same dir at once) | |
if [[ -z "$1" ]]; then | |
echo "Need either a path or 'pop' as an argument" | |
exit 1 | |
fi |
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 tagalog | |
import "fmt" | |
func Tagalog(tags ...interface{}) func(...interface{}) { | |
return func (args ...interface{}) { | |
fmt.Println(append(args, tags...)...) | |
} | |
} |
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/zsh | |
tmux \ | |
new-session -d -s $sessionName -n emacs 'emacs .' \;\ | |
new-window -n 'app' "bin/run" \;\ | |
new-window -n 'build' "bin/build" \;\ | |
new-window -n 'tests' "bin/test" \;\ | |
new-window -n git \;\ | |
selectw -t emacs |
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
This gist is old. Check out http://gijs.github.io/blog/2014/09/09/docker-and-service-discovery/ |
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
CAPITAL = 100000 | |
REAL_ESTATE_RETURN_RATE = .1 / 12 | |
INCOME_TAX = .28 | |
EARLY_WITHDRAWAL_PENALTY = .1 | |
LONG_TERM_CAPITAL_GAINS_TAX = .2 | |
PERIODS = 30*12 | |
# early withdrawal | |
investment = CAPITAL * (1 - (EARLY_WITHDRAWAL_PENALTY + INCOME_TAX)) |
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
MATCHES=$(grep -rn --exclude-dir=node_modules --exclude-dir=.git "DONTCOMMIT\|<<<<" .) | |
if [ $? == 0 ]; then | |
echo "remove DONTCOMMITs and conflicts before committing" | |
echo $MATCHES | |
exit 1 | |
fi |
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
# the DOCKER_WRAPPER bit silences the warning that results from running the latest git version | |
vagrant ssh -c "echo 'DOCKER_WRAPPER'; sudo docker $@" 2>/dev/null | sed '1,/DOCKER_WRAPPER/d' |
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
# auto stop in pdb on noneexceptions | |
def info(exc_type, value, tb): | |
# dont do anything for keyboard interrupts or exit signals | |
if exc_type in (KeyboardInterrupt, SystemExit): | |
return | |
if hasattr(sys, 'ps1') or not sys.stderr.isatty(): | |
# we are in interactive mode or we don't have a tty-like | |
# device, so we call the default hook | |
sys.__excepthook__(exc_type, value, tb) | |
else: |
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 [ $# -lt 2 ]; then | |
echo "Usage: $0 <key-file> <host> [<user>]" | |
return | |
fi | |
key="$1" | |
host="$2" | |
user="$USER" | |
if [ $# -eq 3 ]; then | |
user=$3 |
NewerOlder