Skip to content

Instantly share code, notes, and snippets.

@straydogstudio
Created January 8, 2015 18:07
Show Gist options
  • Select an option

  • Save straydogstudio/27837f5d7fc994c96f93 to your computer and use it in GitHub Desktop.

Select an option

Save straydogstudio/27837f5d7fc994c96f93 to your computer and use it in GitHub Desktop.

Revisions

  1. straydogstudio created this gist Jan 8, 2015.
    36 changes: 36 additions & 0 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #upload changed/new files to rails with capistrano
    function capdu {
    if [ -z "$1" ]
    then
    FILES=`gst --porcelain | grep '^ M\|^\?\?' | ruby -e 'puts ARGF.map {|l| l.split()[1]}.join(",")' | xargs echo`
    else
    FILES=`gst --porcelain | grep '^ M\|^\?\?' | grep $1 | ruby -e 'puts ARGF.map {|l| l.split()[1]}.join(",")' | xargs echo`
    fi
    if [ -z "$FILES" ]
    then
    echo "No modified files exist"
    else
    echo "Sending FILES: $FILES"
    cap deploy:upload FILES=$FILES deploy:restart
    fi
    }

    # open the last database migration in sublime
    alias sublm='subl db/migrate/`ls -tr db/migrate/ | tail -1`'

    # bundler
    alias be='bundle exec'
    alias ber='bundle exec rake'
    alias bes='bundle exec rspec'
    alias bel='bundle exec rails'
    alias beg='bundle exec guard'

    # git
    alias ga='git add .'
    alias gc='git commit -v -a'
    alias gd='git diff | subl &'
    alias gl='git pull'
    alias gp='git push'
    alias gst='git status'

    alias h='history'