Skip to content

Instantly share code, notes, and snippets.

@ceoaliongroo
Last active November 24, 2015 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ceoaliongroo/d06945eff8bd9c575591 to your computer and use it in GitHub Desktop.
Save ceoaliongroo/d06945eff8bd9c575591 to your computer and use it in GitHub Desktop.
My .bash_profile
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Set PATH
export PATH="/Applications/MAMP/Library/bin/:$PATH"
# export PATH="/Applications/MAMP/bin/php/php5.5.10/:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
# Set Java Apache Maven Path
export M2_HOME=/usr/local/apache-maven-3.3.3
export PATH=$PATH:$M2_HOME/bin
# Export JAVA_HOME
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
## To keep the ssh-key in memory (Migdal)
ssh-add ~/.ssh/id_bitbucket
# return branch number with git status.
# gs
getMaster() {
clear
git fetch
git checkout master
git pull origin master
}
# merge master into an specific branch.
# gmm 23
mergeWithMaster() {
git checkout $1
git merge master
}
# merge a specific branch into master.
# gm 23
mergeMasterSquash() {
git checkout master
git merge $1 --squash
}
# look for behat command.
searchBehatCommand() {
./bin/behat -dl | grep $1
}
# look for behat command./
behatCommandTag() {
clear
./bin/behat --tags=@$1
}
gitCommitPushOriginMaster() {
git commit -am $1
git push origin master
}
gitCommitPushOriginBranch() {
git commit -am "$2"
git push origin $1
}
# Create and access a new folder.
newFolder() {
mkdir $1
cd $1
}
runAu() {
cd ~/Dev/$1
gulp watch
}
runNgd() {
cd /Applications/MAMP/htdocs/$1/client
grunt serve
}
updateDependencies() {
echo "updating dependencies..."
# (
# if [$1 == "-r" && $2 == "au"]
# then
# sudo rm -fR {jspm_packages,node_modules}/
# sudo npm install && jspm install -y
# if
# )
}
mov2gif() {
if [[ -z "$1" ]]
then
echo "ERROR: You need to indicate the mov file to convert."
return
fi
ffmpeg -i $1.mov -filter:v scale=800:-1 -pix_fmt rgb24 -r 10 -f gif - > $1.gif
}
openDemoTriangular() {
pwd
cd ~/Dev/triangular/demo
python -m SimpleHTTPServer
}
alias reterminal="source ~/.bash_profile"
alias aa="atom ~/.bash_profile"
alias gs="git status | grep 'On branch'"
alias gm=getMaster
alias gmwm=mergeWithMaster
alias g+m=mergeWithMaster
alias g-s=mergeMasterSquash
alias bdev="clear && ./bin/behat --tags=@wip"
alias btravis="clear && ./bin/behat --tags=~@wip"
alias btag=behatCommandTag
alias ball="./bin/behat"
alias bc=searchBehatCommand
alias bapi="./bin/behat -dl"
alias newdir=newFolder
alias selenium="sudo java -jar /usr/lib/selenium2/selenium-server-standalone-2.45.0.jar"
alias phantom="phantomjs --webdriver=127.0.0.1:4444"
alias au=runAu
alias path_helper="eval '/usr/libexec/path_helper -s'"
alias ngd=runNgd
alias p+b=gitCommitPushOriginBranch
alias dep=updateDependencies
alias mov2gif=mov2gif
alias ll='ls -las'
alias lhd='ls -ld .?*'
alias ni='clear && negawatt-install'
alias htdocs='clear && cd /Applications/MAMP/htdocs'
alias triangular=openDemoTriangular
alias serve="python -m SimpleHTTPServer"
ulimit -n 2048
## Auto complete git
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment