Skip to content

Instantly share code, notes, and snippets.

@schneidan
Forked from natelandau/.bash_profile
Last active February 3, 2017 22:38
Show Gist options
  • Save schneidan/e99f9d32e9f851a27f03 to your computer and use it in GitHub Desktop.
Save schneidan/e99f9d32e9f851a27f03 to your computer and use it in GitHub Desktop.
# Aliases muthafucka
alias cdmj='cd ~/code/cannabist'
alias cdsd='cd ~/Sites/schneidan/wp-content/themes/schneidan'
alias cdef='cd ~/Sites/expired-film-day/wp-content/themes/expi'
alias cdsdd='cd ~/Sites/schneidan/wp-content/themes/sd17'
alias cdtk='cd ~/Sites/the-know/wp-content/themes/reverb'
alias cdgt='cd ~/Sites/gametracker'
alias cdelex='cd ~/code/election'
alias cdS='cd ~/Sites'
alias cdG='cd ~/Google\ Drive'
alias cdc='cd ~/code'
alias cdmas='cd ~/code/mason/wp-content/themes/mason'
alias cdmason='cd ~/code/mason'
alias cdex='cd ~/Sites/extras'
alias cdli='cd ~/Sites/holidaylights'
alias cdpu='cd ~/Sites/pulitzers'
alias cdbo='cd ~/Sites/bowlen'
alias cdwph='cd ~/code/wordpress-helpers'
alias cdbm='cd ~/Sites/bookmarklets'
# servers and stuff
alias rs='sudo apachectl restart'
alias mstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mstop='sudo /usr/local/mysql/support-files/mysql.server stop'
# git shortcuts
alias gta='git add -u'
alias gtpm='git pull origin master'
alias gtc='git commit -m $@'
alias gts='git status'
alias gtpu='git push'
# purge fastly cache for url
alias fp='curl -X PURGE $@'
# grep recursively, limiting to .php files, and using -rni flags
# usage: 'grp SEARCH_TERM .' where the dot is a location or the current directory
alias grp='grep -rni --include \*.php $@'
# better bash prompt
#PS1='[\u@\h \W]\$ ' # Default
PS1='\[\e[1;32m\]\u\[\e[1;31m\]@\[\e[1;32m\]\h\[\e[1;37m\]:\[\e[1;34m\]\W\[\e[1;37m\]$\[\e[0m\] '
###
# Configure PS1 by using the old value but ensuring it starts on a new line.
###
__configure_prompt() {
PS1=""
if [ "$(__get_terminal_column)" != 0 ]; then
PS1="\n"
fi
PS1+="$PS1_WITHOUT_PREPENDED_NEWLINE"
}
###
# Get the current terminal column value.
#
# From http://stackoverflow.com/a/2575525/549363.
###
__get_terminal_column() {
exec < /dev/tty
local oldstty=$(stty -g)
stty raw -echo min 0
echo -en "\033[6n" > /dev/tty
local pos
IFS=';' read -r -d R -a pos
stty $oldstty
echo "$((${pos[1]} - 1))"
}
# Save the current PS1 for later.
PS1_WITHOUT_PREPENDED_NEWLINE="$PS1"
# Use our prompt configuration function, preserving whatever existing
# PROMPT_COMMAND might be configured.
PROMPT_COMMAND="__configure_prompt;$PROMPT_COMMAND"
# command augmentations
alias cp='cp -v $@'
alias mv='mv -v $@'
alias mkdir='mkdir -pv $@'
alias ll='ls -TGFAhlp $@'
alias less='less -efN'
cd() { builtin cd "$@"; ls -TGFAhlp .; }
alias cd..='cd ../'
alias cd...='cd ../../'
alias ..='cd ../'
alias ...='cd ../../'
alias edit='subl $@'
alias f='open -a Finder ./'
alias ~="cd ~"
alias c='clear'
alias which='type -all $@'
alias grep='grep --color=auto $@'
alias shop='open -a Adobe\ Photoshop\ CS6 $@'
alias ffmpeg='noti -t "FFMPEG" -m "Conversion complete!" ffmpeg'
alias rap='sudo apachectl restart'
# bash editor and reloader
alias bashed='sudo vi ~/.profile'
alias bashup='source ~/.profile'
# massive recursive directory listing
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
export PATH=/opt/local/bin:/usr/local/sbin:/opt/local/sbin:/usr/local/mysql/bin:/Applications/Sublime\ Text.app//Contents/SharedSupport/bin:$PATH:~
# virtualenv stuff
export WORKON_HOME=~/Env
source /usr/local/bin/virtualenvwrapper.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment