-
Notifications
You must be signed in to change notification settings - Fork 1
/
alias
114 lines (81 loc) · 2.81 KB
/
alias
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
#!/usr/bin/env sh
# The most important alias ever
alias fucking=sudo
# Copy an emoji
alias e='emoji $(jot -r 1 1 852) | tr -d "\n" | pbcopy'
# Copy an insult
alias i='insult | tr -d "\n" | pbcopy'
# Copy an insult in all caps
alias I='insult | tr -d "\n" | tr "[a-z]" "[A-Z]" | pbcopy'
# Just a nice little alias so I can open chrome with switches easily
alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
# Easy up to parent
alias ..='cd ..'
# ..x for going up x levels, up to 5
for i in {2..5}; do
alias "..$i"="cd $(printf "../%.0s" $(seq 1 $i))"
done
alias pjson='python -m json.tool'
# Easily reinstall my IE VMs if the trial period ends
alias getievms='curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | env INSTALL_PATH="$IEVMS_INSTALL_PATH" IEVMS_VERSIONS="8 9 10 11" bash'
# View recently created processes
alias rp="watch -n 0 -t 'ps -u "'$USER | tail -n $(tput lines) | cut -c1-$(tput cols)'"'"
# Sublime Text 3 subl alias
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
# Easy alias for django-admin.py
alias dj='django-admin.py'
# Copy files to the pasteboard easily
alias pb='pbcopy < '
# Tools for opening files in different browsers
# Chrome
alias chr='open -a Google\ Chrome'
# Firefox
alias ffx='open -a Firefox'
# Safari
alias saf='open -a Safari'
# Opera
alias opr='open -a Opera'
# Fix tmux 256 colors
alias tmux='tmux -2'
# Keep the system alive and screen on.
alias stayup='caffeinate -dimsut 999999999999'
# Seriously docker-machine is annoying to type out every time.
alias dm='docker-machine'
# Easier virtualenv activation
function vact {
. "${1:-venv}/bin/activate"
}
# Easy pull requests
function pr {
open "http://$(git remote -v | grep origin | grep '(fetch)$' | cut -d ' ' -f2 | cut -d@ -f2 | cut -d' ' -f1 | sed 's/\.git$//' | tr : /)/compare/$(git rev-parse --abbrev-ref HEAD)?expand=1"
}
# Easy to make gource videos
function mkgource {
gource -1280x720 --git-branch ${1:-master} --stop-at-end --hide progress --user-image-dir .git/avatar/ -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -crf 1 -threads 0 -bf 0 gource.mp4
}
# Quick alias for git
alias g='git'
function build_git_aliases {
local al
local cm
while read -r line; do
al=$(echo $line | cut -d ' ' -f 1)
al=${al#alias.}
cm=$(echo $line | cut -d ' ' -f 2-)
if [[ ${cm:0:1} != '!' ]]; then
cm="git $cm"
else
cm=$(echo $cm | sed -E 's/^! *//')
fi
if ! type "g$al" &> /dev/null; then
alias "g$al"="$cm"
fi
if ! type $al &> /dev/null; then
alias "$al"="$cm"
fi
done < <(git config --global --get-regexp '^alias\.')
}
build_git_aliases
alias vi='vim'
alias ':q'='exit'
alias ':q!'='exit'