Skip to content

Instantly share code, notes, and snippets.

@MarcoGomesr
Created March 25, 2018 23:04
Show Gist options
  • Save MarcoGomesr/04d69ce7091bb1fd49d1268fe2e41ba5 to your computer and use it in GitHub Desktop.
Save MarcoGomesr/04d69ce7091bb1fd49d1268fe2e41ba5 to your computer and use it in GitHub Desktop.
.bash_profile
export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/Users/Marco/.composer/vendor/bin/
export PATH="/usr/local/mysql/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
export GOPATH="/Volumes/Backup/dev/Sites/test/go"
#export PATH=$PATH:/Applications/MAMP/Library/bin
#export PATH=$PATH:/Applications/MAMP/bin/php/php5.5.3/bin
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
#source ~/.profile
#export PATH="$PATH:/usr/local/lib/node_modules/karma/bin"
#export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
#aliases
alias ht="http-server"
alias pg="ping 8.8.8.8"
#alias phps="php artisan serve"
#alias php="/Applications/MAMP/bin/php/php5.5.3/bin/php"
alias sites="cd /Volumes/Backup/dev/Sites"
alias desk="cd ~/Desk"
#alias lv="composer create-project laravel/laravel --prefer-dist"
alias wh="cd /Users/Marco/whipgo"
alias ie="cd /Volumes/Backup/dev/Sites/ie-platform"
alias iep="cd /Volumes/Backup/data/Documents/ie-vagrant-vm"
alias gs='git status'
alias gc='git commit -m'
alias ga='git add'
alias gaa='git add .'
alias gl='git log --graph --oneline --decorate --date=relative --all'
#colors
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 256)
else
MAGENTA=$(tput setaf 5)
ORANGE=$(tput setaf 4)
GREEN=$(tput setaf 2)
PURPLE=$(tput setaf 1)
WHITE=$(tput setaf 7)
fi
BOLD=$(tput bold)
RESET=$(tput sgr0)
else
MAGENTA="\033[1;31m"
ORANGE="\033[1;33m"
GREEN="\033[1;32m"
PURPLE="\033[1;35m"
WHITE="\033[1;37m"
BOLD=""
RESET="\033[m"
fi
parse_git_dirty () {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
parse_git_branch () {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
}
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
#Always use color output for `ls`
export NVM_DIR="/Users/Marco/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
@MarcoGomesr
Copy link
Author

-bash: /Users/marcogomesr/.profile: No such file or directory
marcogomesr > ~
$ Local
marcogomesr > ~/Documents/local
$ ls
total 24
drwxr-xr-x 19 marcogomesr staff 646 Feb 20 14:09 .
drwx------+ 10 marcogomesr staff 340 Jan 2 11:17 ..
-rw-r--r--@ 1 marcogomesr staff 10244 Feb 20 14:16 .DS_Store
drwxr-xr-x 15 marcogomesr staff 510 Oct 5 09:31 academicHugo
drwxr-xr-x 6 marcogomesr staff 204 Apr 25 2018 asynchronous-javascript-with-asyn-await
drwxr-xr-x 4 marcogomesr staff 136 Jan 18 15:10 css
drwxr-xr-x 3 marcogomesr staff 102 Apr 18 2018 egghead
drwxr-xr-x 4 marcogomesr staff 136 Feb 20 14:27 hugo
drwxr-xr-x 13 marcogomesr staff 442 Feb 8 14:20 hugo-quickstart
drwxr-xr-x 5 marcogomesr staff 170 May 11 2018 ie10-flex
drwxr-xr-x 4 marcogomesr staff 136 Jan 18 15:10 nuxt
drwxr-xr-x 4 marcogomesr staff 136 Jan 18 15:11 phaser
drwxr-xr-x 4 marcogomesr staff 136 Feb 12 13:25 react
drwxr-xr-x 17 marcogomesr staff 578 Feb 11 17:41 strapi
drwxr-xr-x 10 marcogomesr staff 340 Jan 18 15:10 vue
drwxr-xr-x 3 marcogomesr staff 102 Jan 18 15:09 vuex
drwxr-xr-x 10 marcogomesr staff 340 Oct 1 11:34 webpack-demo
drwxr-xr-x@ 21 marcogomesr staff 714 May 21 2018 wordpress
drwxr-xr-x 22 marcogomesr staff 748 Jun 11 2018 wordpress_
marcogomesr > ~/Documents/local
$ mkdir graphql-react-event-booking
marcogomesr > ~/Documents/local
$ ls graphql-react-event-booking/
total 0
drwxr-xr-x 2 marcogomesr staff 68 Feb 28 12:36 .
drwxr-xr-x 20 marcogomesr staff 680 Feb 28 12:36 ..
marcogomesr > ~/Documents/local
$ cd ~/
marcogomesr > ~
$ ls
total 352
drwxr-xr-x+ 63 marcogomesr staff 2142 Feb 25 09:31 .
drwxr-xr-x 6 root admin 204 Mar 23 2018 ..
-r-------- 1 marcogomesr staff 7 Mar 23 2018 .CFUserTextEncoding
-rw-r--r--@ 1 marcogomesr staff 20484 Feb 21 16:53 .DS_Store
drwx------ 21 marcogomesr staff 714 Feb 22 16:15 .Trash
drwxr-xr-x 2 marcogomesr staff 68 May 17 2018 .VSCodeVim
-rw------- 1 marcogomesr staff 6399 Feb 27 14:15 .bash_history
-rw-r--r--@ 1 marcogomesr staff 2470 Dec 18 11:08 .bash_profile
drwx------ 175 marcogomesr staff 5950 Feb 27 17:08 .bash_sessions
drwxr-xr-x 3 marcogomesr staff 102 Apr 25 2018 .cache
drwxr-xr-x 6 marcogomesr staff 204 May 11 2018 .composer
drwx------ 5 marcogomesr staff 170 Oct 18 11:17 .config
drwx------ 3 marcogomesr staff 102 Mar 29 2018 .cups
drwxr-xr-x 6 marcogomesr staff 204 Jan 24 11:07 .docker
drwx------ 13 marcogomesr staff 442 Feb 15 11:26 .dropbox
drwxr-xr-x 4 marcogomesr staff 136 Mar 26 2018 .gem
-rw-r--r-- 1 marcogomesr staff 427 Feb 25 09:31 .gitconfig
-rw-r--r--@ 1 marcogomesr staff 82 Feb 25 09:31 .gitflow_export
-rw-r--r--@ 1 marcogomesr staff 60 Nov 30 11:37 .gitignore_global
-rw-r--r--@ 1 marcogomesr staff 73 Nov 30 11:37 .hgignore_global
-rw-r--r-- 1 marcogomesr staff 0 Apr 11 2018 .hushlogin
drwxr-xr-x 3 marcogomesr staff 102 Apr 25 2018 .local
drwxr-xr-x 3 marcogomesr staff 102 May 11 2018 .ngrok
drwxr-xr-x 3 marcogomesr staff 102 Apr 6 2018 .node-gyp
-rw------- 1 marcogomesr staff 4 Apr 6 2018 .node_repl_history
drwxr-xr-x 4 marcogomesr staff 136 May 25 2018 .now
drwxr-xr-x 9 marcogomesr staff 306 May 9 2018 .npm
drwxr-xr-x 25 marcogomesr staff 850 May 9 2018 .nvm
drwxr-xr-x 3 marcogomesr staff 102 Mar 27 2018 .oracle_jre_usage
source ~/.profile

alias Dev='cd /Users/marcogomesr/Documents/dev/'
alias Local='cd /Users/marcogomesr/Documents/local/'
export PATH=$PATH:pwd/flutter/bin
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

############ Alias ##############

alias ls='ls -al'
alias gs='git status'
alias gc='git commit -m'
alias ga='git add'
alias gaa='git add .'
alias gl='git log --graph --oneline --decorate --date=relative --all'
alias du='docker-compose up'
alias db='docker-compose build'
alias dd='docker-compose down'
alias ds='docker stop $(docker ps -aq)'

########### colors ###########
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Tell ls to be colourful

export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

Tell grep to highlight matches

export GREP_OPTIONS='--color=auto'

color ls

export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi

if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
NORMAL  .bash_profile  sh  utf-8[unix]  1% ☰ 1/84  : 1 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment