#!/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" alias ro="bundle exec ro" alias ro_client="/home/zxr/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/ro_commands-0.0.2/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.2/bin/ro_server" alias z='zeus' alias zr='z rails' alias g='z g' alias d='z d' alias zs='z s' alias a='z g assets' alias c='zr 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 mi='z rake db:migrate' alias bx='bundle exec' _da () { local cur options command commands _get_comp_words_by_ref cur commands=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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='z rails' alias g='z g' alias d='z d' alias zs='z s' alias a='z g assets' alias c='zr 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 mi='z rake db:migrate' alias bx='bundle exec' alias z='zeus' alias zr='z rails' alias g='z g' alias d='z d' alias zs='z s' alias a='z g assets' alias c='zr 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 mi='z rake db:migrate' alias bx='bundle exec' 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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=$(ro_client rails 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 alias list="ro info list ." alias guard="bundle exec guard" alias sp="smplayer" function record() { recordmydesktop --no-sound --output=$1 } alias work="ro shortcuts work" 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' #idea alias i='idea `pwd`' #rubymine alias r='rubymine `pwd`' alias libspec="ro shortcuts lib_spec" cdir () { path=`ro_client navigate get_dir $1` echo "cd $path" cd "$path" } odir () { cdir $1 rubymine . } # cd to project path cpj () { path=`ro_client navigate get_project $1` echo "cd $path" cd "$path" } pj () { cpj $1 rubymine "$path" } cjpj () { path=`ro_client navigate get_project $1 java` echo "opening $path" cd "$path" } jpj () { path=`ro_client navigate get_project $1 java` echo "opening $path" cd "$path" idea "$path" } alias rco="ro shortcuts open_ro_commands" alias rsu="ro shortcuts open_ro_support" alias spec="ro generate spec_file" alias ex="ro generate ex" alias dl="cd ~/Downloads" alias sshproxy="sudo service ssh-proxy" alias roserver="sudo service ro_server" # cd to dir rp () { cd "$ruby_projects" } dp () { cd "~/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" alias proxy="http_proxy='socks5://127.0.0.1:1080'" alias jk="jekyll" alias jks="jekyll server"