-
Notifications
You must be signed in to change notification settings - Fork 1
/
aliases
76 lines (66 loc) · 2.13 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
#!/usr/bin/env bash
# atom
alias e="atom-nightly ."
# bundler
alias b="bundle"
alias bl="b --local"
alias bu="b update"
alias be="b exec"
# git
_g() {
if [[ $# > 0 ]]; then
hub "$@"
else
hub status
fi
}
alias g=_g
__git_complete g _git # enable bash completion for the `g` alias
alias gl='git pull --prune'
alias gp='git push -u origin head'
alias gd='git diff'
alias gdh='git diff HEAD'
alias gap="git add -p"
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcap='git commit -v -a && git push'
alias gb='git branch'
alias gba='git branch -a'
alias gs='git status'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
alias gco='git branch | cut -c 3- | selecta | xargs git checkout'
alias git-recent-branches='for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r'
alias grb='git-recent-branches'
alias gdone='git checkout master && git pull && git branch -d @{-1}'
# ls
alias l='ls -alh'
alias ltr='ls -ltrh'
# tail
alias tf='tail -f -n 100'
alias t500='tail -n 500'
alias t1000='tail -n 1000'
alias t2000='tail -n 2000'
# rails
alias r='rails'
alias rs='rails server'
alias rc='rails console'
alias rg='rails generate'
alias rdfl='rake db:fixtures:load'
alias rdm='rails db:migrate'
# iterm2 profile switching
alias td='echo -e "\033]50;SetProfile=Dark\a"'
alias tl='echo -e "\033]50;SetProfile=Light\a"'
# misc
alias c=cd
alias dc=docker-compose
alias reload='. ~/.bash_profile'
alias tmux="TERM=screen-256color-bce tmux"
alias h?="history | grep "
alias top-10-shell-commands="history | cut -c8- | cut -d' ' -f1 | sort | uniq -c | sort -nr | head"
alias brewup="echo_and_run brew update && echo_and_run brew cleanup && echo_and_run brew outdated && echo_and_run brew doctor"
alias decaf='decaffeinate --keep-commonjs --prefer-const --loose-default-params --loose-for-expressions --loose-for-of --loose-includes'
# ip addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
# kill stuff to fix camera detection in Zoom video conferencing
alias kill-camera="sudo killall VDCAssistant"