Skip to content

Instantly share code, notes, and snippets.

@ianaya89
Last active October 20, 2017 11:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianaya89/e1d5db0b69f5053a9dff to your computer and use it in GitHub Desktop.
Save ianaya89/e1d5db0b69f5053a9dff to your computer and use it in GitHub Desktop.
Custom Setting for Mac Terminal
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Showing Git Branch.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Enabling Font Colors and Showing Git Banch
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\$(parse_git_branch)\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS= gxBxhxDxfxhxhxhxhxcxcx
# Enabling Git Autocompletation
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Adding Git Alias
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'
alias gc='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'
alias gclean='git clean -fd && git checkout .'
alias gh='git push heroku'
# Adding Mongo Alias
alias mongod='mongod --dbpath ~/Development/Mongo/data'
# Adding Power Off Alias
alias byebye='sudo /sbin/shutdown -h now'
# Adding Edit Alias
alias edit='SUDO_EDITOR="open -FWne" sudo -e'
alias editBash='open -e ~/.bash_profile'
alias editHosts='edit /etc/hosts'
alias editProfile='open -e ~/.profile'
# Adding Go To Alias
alias enrollment="cd ~/Development/Git/TRFEnrollment"
alias safelink="cd ~/Development/Git/TRFEnrollment/Sources/Enrollment/Hosting/BusinessModels/Safelink/CMS/NewPublic"
alias payless="cd ~/Development/Git/payless-app"
alias streetteams="cd ~/Development/Git/TRFEnrollment/Sources/Enrollment/Hosting/BusinessModels/Safelink/CMS/NewStreetTeams"
# Adding Sudo Alias
alias sudo='sudo '
# Adding ReloadProfile Alias
alias reloadProfile=". ~/.profile"
# Adding Shortcuts Alias
alias ll='ls -lh'
alias la='ls -lhA'
alias l='ls'
alias c='clear'
alias x='exit'
alias q='exit'
alias rm='rm -i'
alias rmd='rmdir -i'
# Python Command Server
server(){
python -m SimpleHTTPServer 8000
}
# Gulp Command Server
gulp-server(){
GREEN="\x1b[32;01m"
RESET="\x1b[39;49;00m"
#isGulpInstalled=is-program-installed gulp
#if [$isGulpInstalled -eq 0]
#then
echo -e $GREEN Installing global grunt… $RESET
sudo npm install --global gulp
#fi
echo $GREEN Creating gulp file… $RESET
rm gulpfile.js
touch gulpfile.js
echo "var gulp = require('gulp')," >> gulpfile.js
echo "" >> gulpfile.js
echo "connect = require('gulp-connect');" >> gulpfile.js
echo "" >> gulpfile.js
echo "gulp.task('webserver', function() {" >> gulpfile.js
echo "connect.server({livereload: true});" >> gulpfile.js
echo "});" >> gulpfile.js
echo "" >> gulpfile.js
echo "gulp.task('default', ['webserver']);" >> gulpfile.js
echo Installing gulp local…
sudo npm install --save-dev gulp
echo Installing gulp connect…
sudo npm install --save-dev gulp-connect
gulp
}
function isNPMInstalled {
# set to 1 initially
local return_=1
# set to 0 if not found
ls node_modules | grep $1 >/dev/null 2>&1 || { local return_=0; }
# return value
echo "$return_"
}
function isProgramInstalled {
# set to 1 initially
local return_=1
# set to 0 if not found
type $1 >/dev/null 2>&1 || { local return_=0; }
# return value
echo "$return_"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment