forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaliases
80 lines (65 loc) · 2.11 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
# mate
alias matew='mate -w'
# cd
alias ..='cd ..'
# ls
alias ls="ls -F"
alias l="ls -lAh"
alias ll="ls -l"
alias la='ls -A'
# git
alias glr='git pull --rebase'
alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gdc='git diff --cached'
alias gde='gd | matew'
alias gdce='gdc | matew'
alias gc='git commit -v'
alias gca='git commit -va'
alias gb='git branch -v'
alias gs='git status'
alias gss='git status -sb'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
alias git='hub'
function gco {
if [ -z "$1" ]; then
git checkout master
else
git checkout $1
fi
}
# usage:
# $ superblame Mislav [<from>..<to>]
function superblame {
git log --format=%h --author=$1 $2 | \
xargs -L1 -ISHA git diff --shortstat 'SHA^..SHA' app config/environment* config/initializers/ public/stylesheets/ | \
ruby -e 'n=Hash.new(0); while gets; i=0; puts $_.gsub(/\d+/){ n[i+=1] += $&.to_i }; end' | tail -n1
}
# rails
alias sc='script/console'
alias ss='script/server'
alias sg='script/generate'
alias a='autotest -rails'
alias tlog='tail -f log/development.log'
alias scaffold='script/generate nifty_scaffold'
alias migrate='rake db:migrate db:test:clone'
alias rst='touch tmp/restart.txt'
alias be='bundle exec'
alias cleardb='be rake db:drop db:create db:schema:load db:seed && be rake db:test:clone'
# changing directory to code project
function c { cd ~/code/$1; }
# misc
alias reload='. ~/.bash_profile'
alias time='gtime -f "%e %U %S %P" '
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
alias preview='open -a Preview -f'
alias pg='postgres -D /usr/local/var/postgres/'
alias tunnel='ssh -D 8080 -f -C -q -N'
function repeat { n=$1; shift; for ((i=0;i<n;i++)) do $@; done; }
function httplot {
gnuplot -e "set terminal postscript color; set output \"$2.ps\"; set xlabel \"Concurrent requests\"; set ylabel \"ms\"; plot \"$1.tsv\" using 8 with lines title \"Response time\"";
}
alias checkhosted='HOSTED=$(ey ssh "cat /data/Teambox2/current/REVISION" -e hosted)'
alias permis="stat -f '%p %N'"
alias console="ssh -t tb4util1 'cd /data/teambox/current; make console'"