#!/bin/bash lib="$HOME/Dropbox/utils/lib" learn="$HOME/Dropbox/learn" ruby_projects="$HOME/Dropbox/ruby-projects" js_java_projects="$HOME/Dropbox/js-java-projects" work_project="$ruby_projects/ro_partner" RUBYMINE_HOME="~/Dropbox/RubyMine" alias ro="/home/zxr/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/ro_commands-0.0.3/bin/ro" alias ro_client="/home/zxr/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/ro_commands-0.0.3/bin/ro_client" alias ro_server="/home/zxr/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/ro_commands-0.0.3/bin/ro_server" alias list="ro_client info list ." alias guard="bundle exec guard " alias bx="bundle exec" alias goagenthosts="ro_client crawler get_hosts_for_goagent" alias dbc="zeus rake db:create" alias railsnewapp="ro generate rails_new_app" alias de="zeus g decorator" alias zro="zeus ro" function mi() { zeus rake db:migration zeus rake test:prepare } alias sp="smplayer" alias record="recordmydesktop --no-sound --overwrite -o" alias ad="avidemux --output-format AVI" alias work="bundle exec ro shortcuts work" alias e=rerun_debug #function rerun_debug() { # eval $(xdotool getmouselocation --shell) # xdotool key F10 # xdotool mousemove 14 558 # xdotool click 1 # xdotool click 1 # xdotool key --delay 200 ctrl+F5 # xdotool mousemove $X $Y #} alias ga='git add' alias gaa='ga .' alias gb='git branch' alias gco='git checkout' alias gc='git commit -am' alias gi='git add -i' alias gl='git log --oneline --all --color --graph --decorate' alias gm='git merge' alias gp='git push -u origin master' alias gst='git status' alias gupdatesubmodule="git submodule foreach git pull origin master" alias gh="github" alias navigate="ro_client navigate" #idea alias i='idea `pwd`' #rubymine alias r='rubymine `pwd`' alias libspec="ro shortcuts lib_spec" alias rbm="rubymine" function cd_path() { echo "opening $1" cd "$1" } function rubymine_open_path() { cd_path "$1" rubymine . } function idea_open_path() { cd_path "$1" idea . } cdir () { path=`ro_client navigate get_dir $1` cd_path "$path" } odir () { cdir $1 rubymine . } # cd to project path cpj () { path=`ro_client navigate get_project $1` cd_path "$path" } pj () { cpj $1 rubymine . } cjpj () { path=`ro_client navigate get_project $1 java` echo "cd $path" cd "$path" } jpj () { path=`ro_client navigate get_project $1 java` idea_open_path "$path" } function csub() { path=`navigate get_submodule $1` cd_path $path } function sub() { csub $1 rubymine . } function roadmap() { path=`navigate get_roadmap $1` rubymine_open_path "$path" } alias rco="ro shortcuts open_ro_commands" alias rsu="ro shortcuts open_ro_support" alias unzip="ro misc unzip" alias rn="ro file_actions rename" alias f="ro file_actions find" alias cddownloads="cd ~/Dropbox/Downloads" #gist alias note='bundle exec ro ro_gist upload' alias deprecate='bundle exec ro ro_gist deprecate' #mysql alias mysqlrestart="sudo service mysql restart" alias mysql="mysql -uroot" #process alias pkillf="sudo pkill -f" #grep alias psgrep="ps aux | grep" alias aliasgrep="alias | grep" alias pgrepf="pgrep -f" alias spec="ro generate spec_file" alias ex="ro generate ex" alias dl="cd ~/Downloads" alias sshproxy="sudo service ssh-proxy restart" alias roserver="sudo service ro_server" # cd to dir alias rp="cd ~/Dropbox/ruby-projects" alias dp="cd $HOME/Dropbox" # js java project alias jp="cd $js_java_projects" alias fas="ro_client file_actions" alias rps="ro_client ro_procs" alias rclocal="sudo rubymine /etc/rc.local" alias wp='working_project' alias work_project="cd $work_project" alias l="cd $learn" #find railscasts alias rc="ro_client file_actions find_railscasts" # reload ~/bashrc.erb alias rb="source ~/.bashrc" sock_proxy="socks5://127.0.0.1:1080" alias proxy="http_proxy=$sock_proxy" alias jk="jekyll" alias jks="jekyll server" alias z='zeus' alias zr='zeus rails' alias g='z g' alias d='z d' alias zs='z s' alias zk='zeus rake' alias a='z g assets' alias c='z g controller' alias m='zr migration' alias mo='zr model' alias s='zr scaffold' alias da='d assets' alias dco='d controller' alias dmo='d model' alias dm='d migration' alias ds='d scaffold' _da () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_assets) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _da da _dco () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_controllers) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dco dco _dmo () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_models) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dmo dmo _dm () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_migrations) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dm dm _ds () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_scaffolds) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ds ds _da () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_assets) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _da da _dco () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_controllers) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dco dco _dmo () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_models) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dmo dmo _dm () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_migrations) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dm dm _ds () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_scaffolds) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ds ds alias z='zeus' alias zr='zeus rails' alias g='z g' alias d='z d' alias zs='z s' alias zk='zeus rake' alias a='z g assets' alias c='z g controller' alias m='zr migration' alias mo='zr model' alias s='zr scaffold' alias da='d assets' alias dco='d controller' alias dmo='d model' alias dm='d migration' alias ds='d scaffold' alias z='zeus' alias zr='zeus rails' alias g='z g' alias d='z d' alias zs='z s' alias zk='zeus rake' alias a='z g assets' alias c='z g controller' alias m='zr migration' alias mo='zr model' alias s='zr scaffold' alias da='d assets' alias dco='d controller' alias dmo='d model' alias dm='d migration' alias ds='d scaffold' alias gfi='git init && git flow init -f' alias fr='git flow release' alias frf='fr finish' alias frp='fr publish' alias ff='git flow feature' alias frs='git flow release start' alias ffs='git flow feature start' alias fff='ff finish' alias ffc='ff checkout' _da () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_assets) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _da da _dco () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_controllers) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dco dco _dmo () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_models) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dmo dmo _dm () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_migrations) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dm dm _ds () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_scaffolds) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ds ds _da () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_assets) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _da da _dco () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_controllers) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dco dco _dmo () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_models) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dmo dmo _dm () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_migrations) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _dm dm _ds () { local cur options command commands _get_comp_words_by_ref cur commands=$(zr get_scaffolds) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ds ds _frf () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_releases) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _frf frf _frp () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_releases) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _frp frp _fff () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_features) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _fff fff _ffc () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git flow get_features) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ffc ffc _frf () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_releases) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _frf frf _frp () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_releases) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _frp frp _fff () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git_flow get_features) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _fff fff _ffc () { local cur options command commands _get_comp_words_by_ref cur commands=$(zeus git flow get_features) local cur="${COMP_WORDS[$COMP_CWORD]}" if [ -z "($commands)" ]; then echo '' >> /dev/null else COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi } complete -o default -F _ffc ffc # rrjj alias a="zeus ro rails_navigate access" alias railswork="bundle exec ro rails_shortcuts work"