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
#compdef vagrant | |
local context state line | |
typeset -A opt_args | |
local vagrant_status vagrant_ids | |
vagrant_status=$(vagrant global-status | head -5) | |
vagrant_ids=$(echo $vagrant_status | grep -oE '^[0-9a-z]+' | grep '[0-9]') |
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
# Check for latest version based on environment | |
pull-latest-repo: | |
git.latest: | |
- name: [email protected]:you/your-app.git | |
- rev: {{ salt['pillar.get']('environment') }} | |
- target: /sites/your-app | |
- always_fetch: True | |
# If the previous state made changes, run composer install with environment-specific options | |
/path/to/repository: |
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" | |
) |
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 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 ( | |
"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
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
# 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
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
# 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 )" |
OlderNewer