Skip to content

Instantly share code, notes, and snippets.

@Toady00
Last active October 10, 2015 23:38
Show Gist options
  • Save Toady00/3769131 to your computer and use it in GitHub Desktop.
Save Toady00/3769131 to your computer and use it in GitHub Desktop.
My current dot bash setup
alias la='ls -a'
alias ll='ls -alF'
alias df="df -h"
alias ping="ping -c 4"
alias sping="sudo ping -i 0.1"
alias tb="torquebox"
alias xcode="open -a /Application/Xcode.app"
# http://alias.sh
# compact, colorized git log
alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# make and cd into directory
function mcd() {
mkdir -p "$1" && cd "$1";
}
# sudo fun
alias please='sudo $(history -p !-1)'
# My public IP address
alias myip='curl ip.appspot.com'
function gi() { curl http://www.gitignore.io/api/\$@ ;}
[[ -s /Users/brandon/.nvm/nvm.sh ]] && . /Users/brandon/.nvm/nvm.sh # This loads NVM
[[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion
function tname {
printf "\e]1;$1\a"
}
function wname {
printf "\e]2;$1\a"
}
# colorized prompt
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
PATH=$HOME/local/bin:$HOME/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:$PATH
export SELENIUM_SERVER_JAR=~/bin/selenium-server-standalone-2.20.0.jar
export NODE_PATH=/Users/$USER/local/lib/node_modules
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
## Git Branch prompt
## Stolen from some other gist somewhere?
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\033[1;33m\]'
c_path='\[\e[0;33m\]'
c_git_clean='\[\e[0;36m\]'
c_git_dirty='\[\e[0;35m\]'
else
c_reset=
c_user=
c_path=
c_git_clean=
c_git_dirty=
fi
# Function to assemble the Git part of our prompt.
git_prompt ()
{
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2; then
git_color="$c_git_clean"
else
git_color="$c_git_dirty"
fi
echo " [$git_color$git_branch${c_reset}]"
}
# Thy holy prompt.
PROMPT_COMMAND='PS1="${c_path}\w${c_reset}$(git_prompt)\$ "'
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
if [ -f ~/.bash_prompt ]; then
. ~/.bash_prompt
fi
if [ -f ~/.bash_rvm ]; then
. ~/.bash_rvm
fi
if [ -f ~/.bash_nvm ]; then
. ~/.bash_nvm
fi
if [ -f ~/.bash_osx_name_tabs ]; then
. ~/.bash_osx_name_tabs
fi
if [ -f ~/.bash_functions ]; then
. ~/.bash_functions
fi
[user]
name = Brandon Dennis
email = [email protected]
[color]
ui = true
[core]
editor = gvim -f
excludesfile = /Users/brandon/.gitignore_global
[push]
default = simple
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
#!/user/bin/env ruby
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
ActiveRecord::Base.logger.level = 1 if defined? ActiveRecord::Base
def y(obj)
puts obj.to_yaml
end
rvm_install_on_use_flag=1
rvm_make_flags="-j8"
rvm_archflags="-arch x86_64"
set shiftwidth=2 softtabstop=2
set incsearch ignorecase hlsearch
set nocompatible
syntax on
filetype plugin on
set number
colorscheme elflord
---
BUNDLE_JOBS: '7'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment