From a694d2de9c6673bdd6791c4132a19ab8989a0f99 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Sun, 29 May 2011 15:25:26 -0500 Subject: [PATCH 1/6] Allow specifying jQuery/jQuery UI version number and update defaults --- plugins/available/javascript.plugins.bash | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/plugins/available/javascript.plugins.bash b/plugins/available/javascript.plugins.bash index 2e0b56cb..a480d9e4 100644 --- a/plugins/available/javascript.plugins.bash +++ b/plugins/available/javascript.plugins.bash @@ -3,15 +3,30 @@ # The install directory is hard-coded. TOOD: allow the directory to be specified on the command line. # +[[ -z "$JQUERY_VERSION_NUMBER" ]] && JQUERY_VERSION_NUMBER="1.6.1" +[[ -z "$JQUERY_UI_VERSION_NUMBER" ]] && JQUERY_UI_VERSION_NUMBER="1.8.13" function rails_jquery { curl -o public/javascripts/rails.js http://github.com/rails/jquery-ujs/raw/master/src/rails.js } function jquery_install { - curl -o public/javascripts/jquery.js http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js + if [ -z "$1" ] + then + version=$JQUERY_VERSION_NUMBER + else + version="$1" + fi + curl -o public/javascripts/jquery.js "http://ajax.googleapis.com/ajax/libs/jquery/$version/jquery.min.js" } -function jquery_ui_install { - curl -o public/javascripts/jquery_ui.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js -} \ No newline at end of file +function jquery_ui_install { + if [ -z "$1" ] + then + version=$JQUERY_UI_VERSION_NUMBER + else + version="$1" + fi + + curl -o public/javascripts/jquery_ui.js "http://ajax.googleapis.com/ajax/libs/jqueryui/$version/jquery-ui.min.js" +} From 20d5f97f3e14545a120c1ade2c0404943fec8e41 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 30 May 2011 09:46:22 -0500 Subject: [PATCH 2/6] Load RVM and auto-completion is available No reason not to turn on RVM if it's present and the autocompletion is a huge benefit. --- plugins/available/rvm.plugin.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/available/rvm.plugin.bash b/plugins/available/rvm.plugin.bash index d3c81ed4..97f02146 100644 --- a/plugins/available/rvm.plugin.bash +++ b/plugins/available/rvm.plugin.bash @@ -1,4 +1,14 @@ #!/bin/bash + +# Load RVM, if you are using it +[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm + +# Load the auto-completion script if RVM was loaded. +if [ "$rvm_path" ] +then + [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion +fi + switch () { rvm $1 local v=$(rvm_version) From b740d7f0f731e9029720d012c289dd00056120f1 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 30 May 2011 09:52:30 -0500 Subject: [PATCH 3/6] Make sure that RVM is loaded before defining extras --- plugins/available/rvm.plugin.bash | 37 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/plugins/available/rvm.plugin.bash b/plugins/available/rvm.plugin.bash index 97f02146..e158a800 100644 --- a/plugins/available/rvm.plugin.bash +++ b/plugins/available/rvm.plugin.bash @@ -3,24 +3,27 @@ # Load RVM, if you are using it [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm -# Load the auto-completion script if RVM was loaded. +# Check to make sure that RVM is actually loaded before adding +# the customizations to it. if [ "$rvm_path" ] then + # Load the auto-completion script if RVM was loaded. [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion + + switch () { + rvm $1 + local v=$(rvm_version) + rvm wrapper $1 textmate + echo "Switch to Ruby version: "$v + } + + rvm_default () { + rvm --default $1 + rvm wrapper $1 textmate + } + + function rvm_version () { + ruby --version + } + fi - -switch () { - rvm $1 - local v=$(rvm_version) - rvm wrapper $1 textmate - echo "Switch to Ruby version: "$v -} - -rvm_default () { - rvm --default $1 - rvm wrapper $1 textmate -} - -function rvm_version () { - ruby --version -} \ No newline at end of file From 5e95755a19facc2527cf4c008f0a3458493c1a98 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 2 Jun 2011 20:29:16 -0500 Subject: [PATCH 4/6] Add another alias for clear and add some more aliases to alias-help --- aliases/general.aliases.bash | 64 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index d91fbbb6..1e7d4458 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -15,31 +15,32 @@ then alias ls="ls --color=always" fi -alias c='clear' -alias k='clear' +alias c = 'clear' +alias k = 'clear' +alias cls = 'clear' -alias edit="$EDITOR" -alias page="$PAGER" +alias edit = "$EDITOR" +alias page = "$PAGER" -alias q="exit" +alias q = "exit" -alias irc="$IRC_CLIENT" +alias irc = "$IRC_CLIENT" -alias rb="ruby" +alias rb = "ruby" # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ alias piano="pianobar" -alias ..='cd ..' # Go up one directory -alias ...='cd ../..' # Go up two directories -alias -- -="cd -" # Go back +alias .. = 'cd ..' # Go up one directory +alias ... = 'cd ../..' # Go up two directories +alias -- - = "cd -" # Go back # Shell History -alias h='history' +alias h = 'history' # Tree -alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +alias tree = "find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" # Directory alias md='mkdir -p' @@ -48,22 +49,25 @@ alias rd=rmdir function aliases-help() { echo "Generic Alias Usage" echo - echo " sl = ls" - echo " ls = ls -G" - echo " la = ls -AF" - echo " ll = ls -al" - echo " l = ls -a" - echo " c/k = clear" - echo " .. = cd .." - echo " ... = cd ../.." - echo " - = cd -" - echo " h = history" - echo " md = mkdir -p" - echo " rd = rmdir" - echo " editor = $EDITOR" - echo " pager = $PAGER" - echo " piano = pianobar" - echo " q = exit" - echo " irc = $IRC_CLIENT" - echo + echo " sl = ls" + echo " ls = ls -G" + echo " la = ls -AF" + echo " ll = ls -al" + echo " l = ls -a" + echo " c/k/cls = clear" + echo " .. = cd .." + echo " ... = cd ../.." + echo " - = cd -" + echo " h = history" + echo " md = mkdir -p" + echo " rd = rmdir" + echo " editor = $EDITOR" + echo " pager = $PAGER" + echo " piano = pianobar" + echo " q = exit" + echo " irc = $IRC_CLIENT" + echo " md = mkdir -p" + echo " rd = rmdir" + echo " rb = ruby" + echo } From 81b82a80d279e5578c6720d72e3c8986722e2840 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 3 Jun 2011 07:36:31 -0500 Subject: [PATCH 5/6] Fix an idiot mistake I made --- aliases/general.aliases.bash | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 1e7d4458..79bd7aa0 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -15,32 +15,32 @@ then alias ls="ls --color=always" fi -alias c = 'clear' -alias k = 'clear' -alias cls = 'clear' +alias c='clear' +alias k='clear' +alias cls='clear' -alias edit = "$EDITOR" -alias page = "$PAGER" +alias edit="$EDITOR" +alias pager="$PAGER" -alias q = "exit" +alias q="exit" -alias irc = "$IRC_CLIENT" +alias irc="$IRC_CLIENT" -alias rb = "ruby" +alias rb="ruby" # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ alias piano="pianobar" -alias .. = 'cd ..' # Go up one directory -alias ... = 'cd ../..' # Go up two directories -alias -- - = "cd -" # Go back +alias ..='cd ..' # Go up one directory +alias ...='cd ../..' # Go up two directories +alias -- -="cd -" # Go back # Shell History -alias h = 'history' +alias h='history' # Tree -alias tree = "find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" # Directory alias md='mkdir -p' From b7a0cb6133bfde63deff59e90a614f55028735f4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Jun 2011 20:45:53 -0500 Subject: [PATCH 6/6] Added Homebrew aliases --- aliases/homebrew.aliases.bash | 24 ++++++++++++++++++++++++ bash_it.sh | 1 + 2 files changed, 25 insertions(+) create mode 100644 aliases/homebrew.aliases.bash diff --git a/aliases/homebrew.aliases.bash b/aliases/homebrew.aliases.bash new file mode 100644 index 00000000..051081d9 --- /dev/null +++ b/aliases/homebrew.aliases.bash @@ -0,0 +1,24 @@ +# Some aliases for Homebrew + +alias bup="brew update && brew upgrade" +alias bout="brew outdated" +alias bin="brew install" +alias brm="brew uninstall" +alias bls="brew list" +alias bsr="brew search" +alias binf="brew info" +alias bdr="brew doctor" + +function brew-help() { + echo "Homebrew Alias Usage" + echo + echo "bup = brew update && brew upgrade" + echo "bout = brew outdated" + echo "bin = brew install" + echo "brm = brew uninstall" + echo "bls = brew list" + echo "bsr = brew search" + echo "binf = brew info" + echo "bdr = brew doctor" + echo +} diff --git a/bash_it.sh b/bash_it.sh index 4a9b30d3..d63458a0 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -73,6 +73,7 @@ function bash-it() { echo " rails-help This will list out all the aliases you can use with rails." echo " git-help This will list out all the aliases you can use with git." echo " todo-help This will list out all the aliases you can use with todo.txt-cli" + echo " brew-help This will list out all the aliases you can use with Homebrew" echo " aliases-help Generic list of aliases." echo " plugins-help This will list out all the plugins and functions you can use with bash-it" echo