-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
117 lines (100 loc) · 3.14 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
# Unix
alias mkdir='mkdir -p'
alias l='ls'
alias ll='ls -al'
alias lh='ls -Alh'
alias -g G='| grep'
alias -g M='| less'
alias -g L='| wc -l'
alias -g ONE="| awk '{ print \$1}'"
alias .='clear'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias -- -='cd -'
alias cdc='cd ~/code'
alias cdd='cd ~/dotfiles'
alias cdm='cd ~/code/memberful'
alias cdr='cd ~/code/rails'
alias cds='cd ~/code/shophop'
alias cdw='cd ~/code/webhop'
alias cdt='cd ~/Desktop'
alias cdwp='cd ~/code/memberful-wp/plugin'
alias cdanki='~/Library/Application\ Support/Anki2/'
# IP addresses
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ip='myip'
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# Bundler
alias b="bundle"
# heroku
alias hc='heroku run rails console'
alias hrr='heroku run rake'
alias wh='watch heroku ps'
alias v='nvim'
alias vi='nvim'
alias powr='pkill -USR1 puma-dev'
# git
alias co='git co'
alias com='git co main'
alias cob='git checkout $(git branch | cut -c 3- | pick)'
alias ga='git add --all'
alias gb='git branch'
alias gc='git commit'
alias gcb='git co -b'
alias gcw='ga; git commit -m "wip - do not merge"'
alias gd='git diff'
alias gdh='git diff HEAD'
alias gl='git log'
alias glp='git log --patch'
alias gp='git push'
alias gph='git push heroku'
alias gr='git reset'
alias grc='git rebase --continue'
alias gri='git rebase -i'
alias grs="git reset --soft 'HEAD^1'; git reset"
alias gs='git show'
alias delete_merged_branches='git branch --merged | grep -v "\*" | grep -v -e "^ *master$" -e "^ *main$" | xargs -r git branch -d'
# Convert long SHA into a short one.
alias short='git rev-parse --short '
# Create pull request description based on commit messages.
alias pr='git log --format="* %h **%s**%n%w(0,2,2)%+b" --reverse main..HEAD'
alias prc='pr | pbcopy'
# Rails
alias db="rails dbconsole"
alias dbr="powr && rake db:reset"
alias m="rake db:migrate db:test:prepare"
alias mr="rake db:migrate db:rollback && rake db:migrate db:test:prepare"
alias rt="bundle exec rails test"
alias rst="PARALLEL_WORKERS=4 bundle exec rails test:system"
alias rc='rails console'
alias rr='rails routes'
alias rrg='f() { rails routes --grep $1 | grep -v "\/rails\/" }; f'
alias sk='bundle exec sidekiq -C config/sidekiq.yml'
alias tdl="tail -f log/development.log"
alias ttl="tail -f log/test.log"
alias wds="./bin/webpack-dev-server"
alias tmux="tmux -2"
alias t="tmux"
alias grep='grep --color=auto'
# format JSON
alias json='python3 -mjson.tool'
# Perform GET, POST... requests
# Example: GET google.com
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
alias "$method"="lwp-request -m '$method'"
done
alias headers="curl -v -o /dev/null"
# Memberful
alias mf="memberful"
alias mfp="memberful production"
alias mfs="memberful staging"
# Simple web server
alias ws='python3 -m http.server'
# ngrok.io
alias nt='foreman start -f ngrok.procfile' # ngrok tunnel
# update anki with audio
alias anki='cd ~/code/anki-take-2/; ./bin/add_audio.rb; cd -'