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
bold=`tput bold` | |
normal=`tput sgr0` | |
prompt_user() { | |
echo "${bold}\u${normal} in ${bold}\W${normal} >> " | |
} | |
prompt_vagrant() { | |
# Find closest .vagrant folder or exit | |
# @TODO |
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
source $(brew --prefix nvm)/nvm.sh | |
export NVM_DIR=~/.nvm | |
nvm use default &> /dev/null |
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
# Get current directory | |
# http://stackoverflow.com/a/246128 | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
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
dotil() { | |
echo "Trying '${@}'" | |
until $@; do :; done | |
} | |
inTmux() { | |
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then return 1; fi | |
} | |
pane() { |
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
# These don't seem to actually export the environment variables | |
# boot2docker shellinit &> /dev/null | |
# export DOCKER_CERT_PATH=/Users/nick/.boot2docker/certs/boot2docker-vm | |
# export DOCKER_TLS_VERIFY=1 | |
alias docker-kill-all="docker kill \$(docker ps -q)" | |
alias docker-rm-all="docker rm \$(docker ps -qa)" | |
# alias b2d-start="boot2docker start && export DOCKER_HOST=tcp://:2375" |
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
alias ll='ls -lG' | |
alias l='ls' |
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 ( | |
"time" | |
) | |
type LazyInt chan func() int | |
// Can't use pointer receiver: invalid operation: l <- (func literal) (send to non-chan type *LazyInt) | |
func (l LazyInt) Future(i int) { |
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( | |
"net/http" | |
"net/http/httptest" | |
"log" | |
"io/ioutil" | |
"fmt" | |
) |
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( | |
"fmt" | |
"reflect" | |
) | |
type X struct { | |
Prop int | |
} |
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 _ | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"sort" | |
"time" | |
) |