Skip to content

Instantly share code, notes, and snippets.

@Andsbf
Created Aug 17, 2016
Embed
What would you like to do?
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
# Git-bash-prompt
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
fi
# Bash completions
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Some terminal colors
# export CLICOLOR=1
# export LSCOLORS=ExFxBxDxCxegedabagacad
# alias ls='ls -GFh'
# Personal alias
alias sbp='source ~/.bash_profile'
alias hideFilesOn='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFilesOff='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
# product Git-hooks
source ~/product/tools/bash/git-aliases
# product Env Variables
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
# product Go
export "GOPATH=$HOME/go"
export "PATH=$PATH:$GOPATH/bin"
### Alias for product Apps ###
alias cd_v1='cd ~/product/productv1 && echo -e "\033]6;1;bg;red;brightness;255\a" && echo -e "\033]6;1;bg;green;brightness;0\a" && echo -e "\033]6;1;bg;blue;brightness;0\a"'
alias cd_jambo='cd ~/product/jambo && echo -e "\033]6;1;bg;red;brightness;0\a" && echo -e "\033]6;1;bg;green;brightness;255\a" && echo -e "\033]6;1;bg;blue;brightness;0\a" '
alias cd_chatty='cd ~/product/chatty-panda && echo -e "\033]6;1;bg;red;brightness;255\a" && echo -e "\033]6;1;bg;green;brightness;165\a" && echo -e "\033]6;1;bg;blue;brightness;0\a" '
alias cd_botstore='cd ~/product/botstore && echo -e "\033]6;1;bg;red;brightness;0\a" && echo -e "\033]6;1;bg;green;brightness;90\a" && echo -e "\033]6;1;bg;blue;brightness;255\a"'
alias cd_pandamail='cd ~/product/pandamail && echo -e "\033]6;1;bg;red;brightness;255\a" && echo -e "\033]6;1;bg;green;brightness;255\a" && echo -e "\033]6;1;bg;blue;brightness;0\a" '
alias cd_goverseer='cd ~/go/src/github.com/product-dev/goverseer && echo -e "\033]6;1;bg;red;brightness;160\a" && echo -e "\033]6;1;bg;green;brightness;32\a" && echo -e "\033]6;1;bg;blue;brightness;140\a" '
alias cd_shoal='cd ~/product/shoal && echo -e "\033]6;1;bg;red;brightness;127\a" && echo -e "\033]6;1;bg;green;brightness;127\a" && echo -e "\033]6;1;bg;blue;brightness;127\a" '
alias ww='cd_v1 && printf "\e[31m\nV1 bundle exec rails server\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;V1 Rails Server\007\"" && bundle exec rails server'
alias www='cd_v1 && printf "\e[31m\nV1 bundle exec sidekiq\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;V1 SideKiq\007\"" && bundle exec sidekiq'
alias wj='cd_jambo && printf "\e[32m\nJambo bundle exec rails s -p 3008\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Jambo Rails Server\007\"" && bundle exec rails s -p 3008'
alias wjj='cd_jambo && printf "\e[32m\nJambo bundle exec sidekiq\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Jambo SideKiq\007\"" && bundle exec sidekiq'
alias wcc='cd_chatty && printf "\e[33m\nChatty bundle exec puma -p 3055\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Chatty Puma Server\007\"" && bundle exec puma -p 3055'
alias wccc='cd_chatty && printf "\e[33m\nChatty bundle exec sidekiq\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Chatty Sidekiq\007\"" && bundle exec sidekiq'
alias wcccc='cd_chatty && printf "\e[33m\nChatty tail -f log/development.log\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Chatty Tail\007\"" && tail -f log/development.log'
alias wb='cd_botstore && printf "\e[34m\nBotstore bundle exec ruby ./app.rb\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Botstore app.rb\007\"" && bundle exec ruby ./app.rb'
alias wbb='cd_botstore && printf "\e[34m\nBotstore bundle exec sidekiq -r ./sk.rb\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Botstore SideKiq\007\"" && bundle exec sidekiq -r ./sk.rb'
alias wbbb='cd_botstore && printf "\e[34m\nBotstore bundle exec puma -p 4000\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Botstore Puma Server\007\"" && bundle exec puma -p 4000'
alias wp='cd_pandamail && printf "\e[33m\nPandaMail bundle exec rails s -p 7000\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Pandamail Rails Server\007\"" && bundle exec rails s -p 7000'
alias wpp='cd_pandamail && printf "\e[33m\nPandaMail bundle exec sidekiq -C config/sidekiq.yml\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Pandamail SideKiq\007\"" && bundle exec sidekiq -C config/sidekiq.yml'
alias wg='cd_goverseer && printf "\e[35m\nGO fresh\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Go Fresh\007\"" && fresh'
alias ws='cd_shoal && printf "\e[1m\nShoal bundle exec rails s -p 3005\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Shoal Rails Server\007\"" && bundle exec rails s -p 3005'
alias wss='cd_shoal && printf "\e[1m\nShoal bundle exec sidekiq\033[0m\n\n" && export PROMPT_COMMAND="echo -ne \"\033]0;Shoal SideKiq\007\"" && bundle exec sidekiq'
function initWp () {
osascript &>/dev/null <<EOF
tell application "iTerm"
tell current window
tell current session
write text "ww"
set consoleSession to (split horizontally with same profile)
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "www"
tell consoleSession to write text "cd_v1"
end tell
set jamboTab to (create tab with default profile)
tell jamboTab
tell current session
write text "wj"
set consoleSession to (split horizontally with same profile)
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "wjj"
tell consoleSession to write text "cd_jambo"
end tell
end tell
set chattyTab to (create tab with default profile)
tell chattyTab
tell current session
write text "wcc"
set tailSession to (split horizontally with same profile)
tell tailSession to write text "wcccc"
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "wccc"
tell tailSession to select
set consoleSession to (split vertically with same profile)
tell consoleSession to write text "cd_chatty"
end tell
end tell
set botstoreTab to (create tab with default profile)
tell botstoreTab
tell current session
write text "wb"
set pumaSession to (split horizontally with same profile)
tell pumaSession to write text "wbbb"
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "wbb"
tell pumaSession to select
set consoleSession to (split vertically with same profile)
tell consoleSession to write text "cd_botstore"
end tell
end tell
set mailTab to (create tab with default profile)
tell mailTab
tell current session
write text "wp"
set consoleSession to (split horizontally with same profile)
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "wpp"
tell consoleSession to write text "cd_pandamail"
end tell
end tell
set goTab to (create tab with default profile)
tell goTab
tell current session
write text "wg"
set consoleSession to (split horizontally with same profile)
tell consoleSession to write text "cd_goverseer"
end tell
end tell
set shoalTab to (create tab with default profile)
tell shoalTab
tell current session
write text "ws"
set consoleSession to (split horizontally with same profile)
set sidekiqSession to (split vertically with same profile)
tell sidekiqSession to write text "wss"
tell consoleSession to write text "cd_shoal"
end tell
end tell
end tell
end tell
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment