-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaliases
123 lines (102 loc) · 3.37 KB
/
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
for FUNCTION in ~/.functions/*
. $FUNCTION
# shortcuts -- every keystroke counts!
alias l='ls'
alias ll='ls -lF'
alias la='ls -A'
alias cls='clear; pwd; echo; ls'
alias cll='clear; pwd; echo; ll'
alias cla='clear; pwd; echo; la'
alias cp='cp -r'
alias h='head'
alias retag='ctags -R --exclude=.gitignore --exclude=.git --exclude=log --exclude=tmp *'
alias flogit='find . -name \*.rb | xargs flog'
alias flayit='find . -name \*.rb | xargs flay'
alias ff='flogit && flayit'
alias ss='spring stop'
alias s='rspec'
alias b='bundle'
alias hi="history | more"
alias jformat="python -mjson.tool"
alias vi="nvim"
alias open='reattach-to-user-namespace open'
alias servedir="python -m SimpleHTTPServer"
## Git Shortcuts
alias g='hub'
alias glg='g lg | h; echo'
alias gls='clear; pwd; echo; ls; echo; git s'
alias gl='clear; pwd; echo; glg; echo; ls; echo; git s'
alias ga='g a'
alias gap='g a -p'
alias gpa='gap' # For typos
alias grb='g rb -i origin/master'
alias gittyup='git push'
alias gw='g c -a -m "wip"'
alias gca='g commit --amend'
alias gh='hub browse'
alias gstats='echo \
+$(g d $(g merge-base HEAD master) | ag "^\+" | wc -l | sed -e "s/^[ \t]*//"),\
-$(g d $(g merge-base HEAD master) | ag "^\-" | wc -l | sed -e "s/^[ \t]*//")'
alias gource='gource --max-files 0 -s .3 -i 0'
## Tmux Shortcuts
alias t='tat'
alias 'tls'='tmux list-sessions'
# Rails environments
alias Rt='RAILS_ENV=test'
alias Rd='RAILS_ENV=development'
alias Rp='RAILS_ENV=production'
# Mistakes
alias lgs='gls'
# Notifications for after long-running jobs
alias notify='terminal-notifier -message "Task done!"; bell'
alias push='httparty -a post -r -d "token=AgWcEK3mj1BdXnhapJjz9mJDH18X1M&user=xn6H7TxUCGKTkJOviZxNFy4yMGv27b&title=Process+Finished&message=Put+down+that+beer" https://api.pushover.net/1/messages.json'
# Sleep the computer (OS X only)
alias sleep!='pmset sleepnow'
# Reloading config files
alias .a='. ~/.aliases'
alias .t='tmux source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"'
alias .z='. ~/.zshrc'
# Editing config files
alias ..a='vi ~/.aliases; .a'
alias ..g='vi ~/.gitconfig'
alias ..h='vi ~/.hyperterm.js'
alias ..l='vi ~/.laptop.local'
alias ..p='vi ~/.phoenix.js'
alias ..t='vi ~/.tmux.conf; .t'
alias ..v='vi ~/.config/nvim/init.vim'
alias ..z='vi ~/.zshrc; .z'
alias tc="top-commands"
alias tca="top-commands-all"
# Rails stuff
alias be='bundle exec'
alias ra='rake'
alias r='rails'
alias db='be rake db:migrate db:rollback && g d db/schema.rb && be rake db:migrate && g d db/schema.rb && RAILS_ENV=test rake db:migrate'
alias dbreset='be rake db:drop db:create db:migrate && Rt be rake db:drop db:create db:migrate'
alias prodc='production run rails console'
alias stagc='staging run rails console'
# Docker
alias dc='docker-compose'
alias dm='docker-machine'
alias dcrun='docker-compose run --rm'
# Keep track of device locations
alias devices='dnsimple record:list graysonwright.com'
# Helpful aliases
alias ip="curl --connect-timeout 5 icanhazip.com"
alias bell="echo -n $'\a'"
alias remake="make clean; cls; make"
alias mvi="mvim"
alias optim="open -a ImageOptim"
alias of="openfile"
# Make things colorful!
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# tbot.io
function tbot()
open https://tbot.io/$1
alias tb="tbot"
function gbot()
open https://github.com/thoughtbot/$1
function trello()
tbot t/$(basename $PWD)