First Commit
commit
9c7cd9aa00
|
|
@ -0,0 +1,49 @@
|
|||
# Initialize Bash It
|
||||
|
||||
# Reload Library
|
||||
alias reload='source ~/.bash_profile'
|
||||
|
||||
# Load all files
|
||||
|
||||
# Library
|
||||
LIB="${BASH}/lib/*.bash"
|
||||
for config_file in $LIB
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
|
||||
# Tab Completion
|
||||
COMPLETION="${BASH}/completion/*.bash"
|
||||
for config_file in $COMPLETION
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
|
||||
|
||||
# Plugins
|
||||
PLUGINS="${BASH}/plugins/*.bash"
|
||||
for config_file in $PLUGINS
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
|
||||
# Themes
|
||||
THEMES="${BASH}/themes/*.bash"
|
||||
for config_file in $THEMES
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
|
||||
# Functions
|
||||
FUNCTIONS="${BASH}/functions/*.bash"
|
||||
for config_file in $FUNCTIONS
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
|
||||
# Custom
|
||||
CUSTOM="${BASH}/custom/*.bash"
|
||||
for config_file in $CUSTOM
|
||||
do
|
||||
source $config_file
|
||||
done
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,177 @@
|
|||
#!bash
|
||||
#
|
||||
# git-flow-completion
|
||||
# ===================
|
||||
#
|
||||
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
|
||||
#
|
||||
# The contained completion routines provide support for completing:
|
||||
#
|
||||
# * git-flow init and version
|
||||
# * feature, hotfix and release branches
|
||||
# * remote feature branch names (for `git-flow feature track`)
|
||||
#
|
||||
#
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# To achieve git-flow completion nirvana:
|
||||
#
|
||||
# 0. Install git-completion.
|
||||
#
|
||||
# 1. Install this file. Either:
|
||||
#
|
||||
# a. Place it in a `bash-completion.d` folder:
|
||||
#
|
||||
# * /etc/bash-completion.d
|
||||
# * /usr/local/etc/bash-completion.d
|
||||
# * ~/bash-completion.d
|
||||
#
|
||||
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
|
||||
# your .bashrc:
|
||||
#
|
||||
# source ~/.git-flow-completion.sh
|
||||
#
|
||||
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
|
||||
# $command case in _git:
|
||||
#
|
||||
# flow) _git_flow ;;
|
||||
#
|
||||
#
|
||||
# The Fine Print
|
||||
# --------------
|
||||
#
|
||||
# Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
|
||||
#
|
||||
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
|
||||
|
||||
_git_flow ()
|
||||
{
|
||||
local subcommands="init feature release hotfix"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
feature)
|
||||
__git_flow_feature
|
||||
return
|
||||
;;
|
||||
release)
|
||||
__git_flow_release
|
||||
return
|
||||
;;
|
||||
hotfix)
|
||||
__git_flow_hotfix
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_feature ()
|
||||
{
|
||||
local subcommands="list start finish publish track diff rebase checkout pull"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
pull)
|
||||
__gitcomp "$(__git_remotes)"
|
||||
return
|
||||
;;
|
||||
checkout|finish|diff|rebase)
|
||||
__gitcomp "$(__git_flow_list_features)"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_features) <(__git_flow_list_remote_features))"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp "$(__git_flow_list_remote_features)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_features ()
|
||||
{
|
||||
git flow feature list 2> /dev/null | tr -d ' |*'
|
||||
}
|
||||
|
||||
__git_flow_list_remote_features ()
|
||||
{
|
||||
git branch -r 2> /dev/null | grep "origin/$(__git_flow_feature_prefix)" | awk '{ sub(/^origin\/$(__git_flow_feature_prefix)/, "", $1); print }'
|
||||
}
|
||||
|
||||
__git_flow_feature_prefix ()
|
||||
{
|
||||
git config gitflow.prefix.feature 2> /dev/null || echo "feature/"
|
||||
}
|
||||
|
||||
__git_flow_release ()
|
||||
{
|
||||
local subcommands="list start finish"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_releases)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
__git_flow_list_releases ()
|
||||
{
|
||||
git flow release list 2> /dev/null
|
||||
}
|
||||
|
||||
__git_flow_hotfix ()
|
||||
{
|
||||
local subcommands="list start finish"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_hotfixes)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_hotfixes ()
|
||||
{
|
||||
git flow hotfix list 2> /dev/null
|
||||
}
|
||||
|
||||
# temporarily wrap __git_find_on_cmdline() for backwards compatibility
|
||||
if [ -z "`type -t __git_find_subcommand`" ]; then
|
||||
alias __git_find_subcommand=__git_find_on_cmdline
|
||||
fi
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# Bash completion support for Rake, Ruby Make.
|
||||
|
||||
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
|
||||
|
||||
_rakecomplete() {
|
||||
if [ -f Rakefile ]; then
|
||||
recent=`ls -t .rake_tasks~ Rakefile **/*.rake 2> /dev/null | head -n 1`
|
||||
if [[ $recent != '.rake_tasks~' ]]; then
|
||||
rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~
|
||||
fi
|
||||
COMPREPLY=($(compgen -W "`cat .rake_tasks~`" -- ${COMP_WORDS[COMP_CWORD]}))
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o default -o nospace -F _rakecomplete rake
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Your Custom Bash alias', functions, etc.
|
||||
#
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
function rh {
|
||||
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
|
||||
}
|
||||
|
||||
function ips {
|
||||
ifconfig | grep "inet " | awk '{ print $2 }'
|
||||
}
|
||||
|
||||
|
||||
# View man documentation in Preview
|
||||
pman () {
|
||||
man -t "${1}" | open -f -a /Applications/Preview.app/
|
||||
}
|
||||
|
||||
|
||||
pcurl() {
|
||||
curl "${1}" | open -f -a /Applications/Preview.app/
|
||||
}
|
||||
|
||||
pri() {
|
||||
ri -T "${1}" | open -f -a /Applications/Preview.app/
|
||||
}
|
||||
|
||||
|
||||
# disk usage per directory
|
||||
usage ()
|
||||
{
|
||||
if [ $1 ]
|
||||
then
|
||||
du -hd $1
|
||||
else
|
||||
du -hd 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
function git_remote {
|
||||
echo "Running: git remote add origin ${GIT_HOSTING}:$1.git"
|
||||
git remote add origin $GIT_HOSTING:$1.git
|
||||
}
|
||||
|
||||
function git_first_push {
|
||||
echo "Running: git push origin master:refs/heads/master"
|
||||
git push origin master:refs/heads/master
|
||||
}
|
||||
|
||||
function git_remove_missing_files() {
|
||||
git ls-files -d -z | xargs -0 git update-index --remove
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
function nginx_reload() {
|
||||
FILE="${NGINX_PATH}/logs/nginx.pid"
|
||||
if [ -e $FILE ]; then
|
||||
echo "Reloading NGINX..."
|
||||
PID=`cat $NGINX_PATH/logs/nginx.pid`
|
||||
sudo kill -HUP $PID
|
||||
else
|
||||
echo "Nginx pid file not found"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function nginx_stop() {
|
||||
FILE="${NGINX_PATH}/logs/nginx.pid"
|
||||
if [ -e $FILE ]; then
|
||||
echo "Stopping NGINX..."
|
||||
PID=`cat $NGINX_PATH/logs/nginx.pid`
|
||||
sudo kill -INT $PID
|
||||
else
|
||||
echo "Nginx pid file not found"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function nginx_start() {
|
||||
FILE="${NGINX_PATH}/sbin/nginx"
|
||||
if [ -e $FILE ]; then
|
||||
echo "Starting NGINX..."
|
||||
sudo $NGINX_PATH/sbin/nginx
|
||||
else
|
||||
echo "Couldn't start nginx"
|
||||
fi
|
||||
}
|
||||
|
||||
function nginx_restart() {
|
||||
FILE="${NGINX_PATH}/logs/nginx.pid"
|
||||
if [ -e $FILE ]; then
|
||||
echo "Stopping NGINX..."
|
||||
PID=`cat $NGINX_PATH/logs/nginx.pid`
|
||||
sudo kill -INT $PID
|
||||
sleep 1
|
||||
echo "Starting NGINX..."
|
||||
sudo $NGINX_PATH/sbin/nginx
|
||||
else
|
||||
echo "Nginx pid file not found"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# List directory contents
|
||||
alias sl=ls
|
||||
alias ls='ls -G' # Compact view, show colors
|
||||
alias la='ls -AF' # Compact view, show hidden
|
||||
alias ll='ls -al'
|
||||
alias l='ls -a'
|
||||
|
||||
alias c='clear'
|
||||
alias k='clear'
|
||||
|
||||
alias ..='cd ..' # Go up one directory
|
||||
alias ...='cd ../..' # Go up two directories
|
||||
alias -- -="cd -" # Go back
|
||||
|
||||
# Shell History
|
||||
alias h='history'
|
||||
|
||||
#
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# colored grep
|
||||
export GREP_OPTIONS='--color=auto'
|
||||
export GREP_COLOR='1;33'
|
||||
|
||||
# colored ls
|
||||
export LSCOLORS='Gxfxcxdxdxegedabagacad'
|
||||
|
||||
# Apply theming defaults
|
||||
PS1="%n@%m:%~%# "
|
||||
|
||||
# Load the theme
|
||||
source "$BASH/themes/$BASH_THEME/$BASH_THEME.bash"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
export GREP_OPTIONS='--color=auto'
|
||||
export GREP_COLOR='1;32'
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# append to bash_history if Terminal.app quits
|
||||
shopt -s histappend
|
||||
|
||||
# history handling
|
||||
#
|
||||
# Erase duplicates
|
||||
# Bash History
|
||||
export HISTCONTROL="ignoredups"
|
||||
export HISTCONTROL=erasedups
|
||||
|
||||
# resize history size
|
||||
export HISTSIZE=5000
|
||||
|
||||
|
||||
export AUTOFEATURE=true autotest
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Desktop Programs
|
||||
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
|
||||
alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
|
||||
alias preview="open -a '/Applications/Preview.app'"
|
||||
alias xcode="open -a '/Developer/Applications/Xcode.app'"
|
||||
alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
|
||||
alias safari="open -a safari"
|
||||
alias firefox="open -a firefox"
|
||||
alias dashcode="open -a dashcode"
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
# Aliases
|
||||
alias g='git'
|
||||
alias gst='git status'
|
||||
alias gl='git pull'
|
||||
alias gup='git fetch && git rebase'
|
||||
alias gp='git push'
|
||||
alias gd='git diff | mate'
|
||||
alias gdv='git diff -w "$@" | vim -R -'
|
||||
alias gc='git commit -v'
|
||||
alias gca='git commit -v -a'
|
||||
alias gb='git branch'
|
||||
alias gba='git branch -a'
|
||||
alias gcount='git shortlog -sn'
|
||||
alias gcp='git cherry-pick'
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
function tab() {
|
||||
osascript 2>/dev/null <<EOF
|
||||
tell application "System Events"
|
||||
tell process "Terminal" to keystroke "t" using command down
|
||||
end
|
||||
tell application "Terminal"
|
||||
activate
|
||||
do script with command "cd \"$PWD\"; $*" in window 1
|
||||
end tell
|
||||
EOF
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# These is some Alias' for Rails
|
||||
#
|
||||
|
||||
alias ss='script/server'
|
||||
alias sc='script/console'
|
||||
alias restart_app='touch tmp/restart.txt'
|
||||
|
||||
|
||||
# Rails Commands
|
||||
alias r='rails'
|
||||
alias rg='rails g'
|
||||
alias rs='rails s'
|
||||
alias rc='rails c'
|
||||
alias rn='rails new'
|
||||
alias rd='rails dbconsole'
|
||||
alias rp='rails plugin'
|
||||
alias ra='rails application'
|
||||
alias rd='rails destroy'
|
||||
|
||||
alias devlog='tail -f log/development.log'
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function remove_gem {
|
||||
gem list | grep $1 | awk '{ print $1; }' | xargs sudo gem uninstall
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
rm_svn(){
|
||||
find $1 -name .svn -print0 | xargs -0 rm -rf
|
||||
}
|
||||
|
||||
svn_add(){
|
||||
svn status | grep '^\?' | sed -e 's/? *//' | sed -e 's/ /\ /g' | xargs svn add
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# Textmate
|
||||
alias e='mate . &'
|
||||
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'
|
||||
alias em="emacs"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# VIM
|
||||
alias v='mvim --remote-silent'
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# Some Colors
|
||||
BGREEN='\[\033[1;32m\]'
|
||||
GREEN='\[\033[0;32m\]'
|
||||
BRED='\[\033[1;31m\]'
|
||||
RED='\[\033[0;31m\]'
|
||||
BBLUE='\[\033[1;34m\]'
|
||||
BLUE='\[\033[0;34m\]'
|
||||
PINK='\[\e[37;1;35m\]'
|
||||
NORMAL='\[\033[00m\]'
|
||||
|
||||
WHITE='\[\033[1;37m\]'
|
||||
BLACK='\[\033[0;30m\]'
|
||||
LIGHT_BLUE='\[\033[1;34m\]'
|
||||
LIGHT_GREEN='\[\033[1;32m\]'
|
||||
LIGHT_CYAN='\[\033[1;36m\]'
|
||||
LIGHT_RED='\[\033[1;31m\]'
|
||||
LIGHT_PURPLE='\[\033[1;35m\]'
|
||||
LIGHT_YELLOW='\[\033[1;33m\]'
|
||||
LIGHT_GRAY='\[\033[0;37m\]'
|
||||
YELLOW='\[\033[0;33m\]'
|
||||
PURPLE='\[\033[0;35m\]'
|
||||
CYAN='\[\033[0;36m\]'
|
||||
GRAY='\[\033[1;30m\]'
|
||||
|
||||
D=$'\e[37;40m'
|
||||
PINK=$'\e[35;40m'
|
||||
GREEN=$'\e[32;40m'
|
||||
ORANGE=$'\e[33;40m'
|
||||
|
||||
function prompt_char {
|
||||
git branch >/dev/null 2>/dev/null && echo '±' && return
|
||||
hg root >/dev/null 2>/dev/null && echo '☿' && return
|
||||
echo '○'
|
||||
}
|
||||
|
||||
function parse_git_dirty {
|
||||
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
|
||||
}
|
||||
|
||||
function parse_git_branch {
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
export PS1='\[\033[1;34m\]$(prompt_char)\[\033[1;32m\] $(parse_git_branch) ${ORANGE}\h ${D}in ${GREEN}\w ${D}→ '
|
||||
Loading…
Reference in New Issue