Skip to content

Instantly share code, notes, and snippets.

@AaronJackson
Last active December 10, 2015 09:29
Show Gist options
  • Save AaronJackson/4414647 to your computer and use it in GitHub Desktop.
Save AaronJackson/4414647 to your computer and use it in GitHub Desktop.
My .profile file
# Hmm... Colours
Black="\[\033[0;30m\]" Red="\[\033[0;31m\]" Green="\[\033[0;32m\]" Cyan="\[\033[0;36m\]"
Yellow="\[\033[0;33m\]" Blue="\[\033[0;34m\]" Purple="\[\033[0;35m\]" White="\[\033[0;37m\]"
# MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Web Development
export PATH=/Development:$PATH
export PATH=/Development/php5/bin:$PATH
export PATH=/Development/mysql/bin:$PATH
export PATH=/Development/mongodb/bin:$PATH
# Android platform tools
export PATH=/Applications/Android\ Studio.app/sdk/platform-tools:$PATH
# I would have preferred it if Heroku was in /opt... never mind
export PATH="/usr/local/heroku/bin:$PATH"
# Local bin
export PATH=/Users/aaron/bin:$PATH
# nano.. vim.. pah!
export EDITOR='subl -w'
# Setup the colour and style of my Terminal :3
export CLICOLOR=1
export LSCOLORS=CxGxcxdxCxegedabagacad
if [ $SHELL = "/bin/bash" ]; then
export PS1=$Green'\h:'$Red'\W'$Cyan'`_ps1_git_branch` '$Purple'\u'$White'\$ '
fi
if [ $SHELL = "/bin/zsh" ]; then
PS1=$'\e[0;31m$ \e[0m'
fi
# Tab complete is awesome
. /usr/local/git/contrib/completion/git-completion.bash
complete -W "$(echo `cat ~/.ssh/config | grep "^Host " | cut -c6- | tr "\n" " "`) $(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
complete -W "SystemUIServer Dock Finder Twitter Skype iTunes Google\ Chrome" killall
# Useful aliases
alias finder='open -a Finder `pwd`'
alias e='subl .'
# Sometimes it is nice to have a 1GB temporary but fast drive
function ramdisk
{
diskutil eraseVolume HFS+ ${1:-Snuggles} `hdid -nomount ram://$((1024*2048))`
}
# Why isn't this on Mac OS?
function ssh-copy-id
{
[ -z "$1" ] && return;
cat ~/.ssh/id_rsa.pub | ssh $1 "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"
}
# Shows my git branch, called from PS1
function _ps1_git_branch
{
[ -d '.git' ] && echo '('`git branch --no-color | grep "* " | cut -c3-`')'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment