/
bash_aliases
104 lines (78 loc) · 2.85 KB
/
bash_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
alias reload='source ~/.profile'
alias r='source ~/.profile'
alias c='clear'
alias q='exit'
alias s='start' # figures out how to start project server
alias h='history'
alias hsearch='history | grep --color=auto'
alias hstats='history | awk '\''{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}'\'' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10'
alias localip="ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'"
alias remoteip="curl -s http://checkip.dyndns.com/ | sed 's/[^0-9\.]//g'"
alias aliases="alias | sed 's/alias //g' | sed 's/=/ = /g'"
alias paths='echo -e ${PATH//:/\\n}' # pretty print all paths
# ========================================
# Git
# ========================================
alias g='git'
alias gb='git branch'
alias gci='git commit'
alias gco='git checkout'
alias gfo='git fetch origin'
alias gs='git status'
alias guci='git reset --soft HEAD^' # undo last commit
# ========================================
# File Management
# ========================================
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple’s System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
# ========================================
# Directory Navigation
# ========================================
alias opendir='open -R .'
alias ..='cd ..'
alias ...='cd ../..'
alias ~='cd ~'
alias home='cd ~'
alias docs='cd ~/Documents'
alias documents='cd ~/Documents'
alias p='cd ~/Projects'
alias projects='cd ~/Projects'
alias dotfiles='cd ~/Projects/dotfiles'
alias jj='cd ~/Projects/javierjulio'
# ========================================
# Ruby
# ========================================
alias be='bundle exec'
alias bi='bundle install'
alias bu='bundle update'
alias bo='bundle outdated'
alias bopen='bundle open' # bundle open GEM_NAME
alias ber='bundle exec rake'
alias bert='bundle exec rake test'
alias rt='bundle exec ruby -Itest'
# ========================================
# Rails
# ========================================
alias rs='bundle exec rails log:clear && start'
alias berc='bundle exec rails console'
alias berdm='bundle exec rails db:migrate'
alias rl='tail -f log/development.log'
# ========================================
# Heroku
# ========================================
alias hrc='heroku run rails console'
alias hrr='heroku run rake'
alias hrdm='heroku run rake db:migrate'
alias hp='heroku ps'
# ========================================
# Applications
# ========================================
# Examples
#
# coda ~/Documents/Notes.txt
# iawriter ~/Documents/Notes.txt
#
alias coda='open -b com.panic.Coda2'
alias iawriter='open -b jp.informationarchitects.WriterForMacOSX'