Skip to content

Commit

Permalink
zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
dubiousdavid committed Mar 8, 2017
1 parent 629a2d6 commit 8a79846
Showing 1 changed file with 41 additions and 14 deletions.
55 changes: 41 additions & 14 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,19 @@ export BROWSER="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Aliases
alias c=clear
alias g=git
alias gc="git commit"
alias gs="git status"
alias ga="git add"
alias magit="emacs -nw --load='~/.emacs.d/magit-init.el' --no-splash"
# alias magit="emacsclient -nw -e '(magit-status-window)'"
alias v=nvim
alias e="emacs -nw"
# alias e="emacsclient -nw -a ''"
alias dk=docker
alias reload="source ~/.zshrc"
alias sed="sed -E"
alias qa="AWS_PROFILE=qa"
alias maurice="git log --after='yesterday' --author='Maurice'"
alias ports="lsof -iTCP -sTCP:LISTEN -n -P"
alias b=bible
alias consul-start="consul agent -server -bootstrap -ui -log-level debug -node local-dev -bind=127.0.0.1 -data-dir ~/Projects/Consul/data"
alias jpp="jq '.'"
# Paging via Vim
export MANPAGER="nvim -c 'set ft=man' -"
export PAGER="nvim -c PAGER -"
# export PAGER="nvim -c PAGER -"
# Go
export GOPATH=$PROJ/Go
export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin
Expand Down Expand Up @@ -161,18 +154,36 @@ docs() {
}

# Start Redis
redis() {
redis-start() {
local containerId
containerId=$(findContainerId redis)

if [[ -z $containerId ]]; then
echo "Starting redis..."
docker run -d -p 6379:6379 redis
docker run -d -p 6379:6379 -v ~/data/redis:/data redis redis-server --appendonly yes
else
echo "redis already running ($containerId)"
fi
}

# Stop redis
redis-stop() {
local containerId
containerId=$(findContainerId redis)
docker kill $containerId
}

redis() {
case $1 in
stop) redis-stop ;;
restart)
redis-stop
redis-start
;;
*) redis-start ;;
esac
}

truncate-alerts-visible() {
aws dynamodb scan --table-name UserAlertsVisible |
jq -c '.Items[] | {userId: .userId, userAlertId: .userAlertId}' |
Expand Down Expand Up @@ -200,14 +211,30 @@ current-branch() {
git rev-parse --abbrev-ref HEAD
}

push-current() {
git push -u origin "$(current-branch)"
}

contains-branch() {
local branch=$1

git log --oneline | grep $(git show-branch --sha1-name $branch | sed 's/\[(.*)\].*/\1/')
}

# Generate a new local application.json file
gen-config() {
node $PROJ/BoomTownROI/service-configuration/generate.js -s '{"sqlDatabase": "boomtown_david"}' > \
$PROJ/config/local/scala/application.json
show-tabs() {
grep $'\t' $1
}

endpoint() {
local env=$1
gatewayIds=($(aws apigateway get-rest-apis --region us-east-1 --query "items[?contains(name, '$env') == \`true\`].id" --output text))
echo "https://$gatewayIds.execute-api.us-east-1.amazonaws.com/V1"
}

serve() {
if [[ -z $1 ]]; then
browser-sync start --server
else
browser-sync start --server --files "$1"
fi
}

0 comments on commit 8a79846

Please sign in to comment.