-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dev_aliases
53 lines (45 loc) · 1.44 KB
/
.dev_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
alias be="bundle exec"
alias berk="bundle exec rake"
alias bemigr="time bundle exec rake --trace db:migrate"
alias bestat="bundle exec rake db:migrate:status"
alias beroll="bundle exec rake --trace db:rollback"
alias bedown="bundle exec rake db:migrate:status | grep -n ' down '"
alias bert="bundle exec rake test"
alias bertr="bundle exec rake test:recent"
alias bertf="bundle exec rake test:functionals"
alias bertu="bundle exec rake test:units"
alias besp="bundle exec rspec"
alias bespm="bundle exec rspec spec/models"
alias bespc="bundle exec rspec spec/controllers"
alias bespv="bundle exec rspec spec/views"
alias berl="bundle exec rails"
alias berc="bundle exec rails c"
alias bers="bundle exec rails s"
# Rust
alias ct="hr v ; cargo test -- --test-threads=1 --nocapture --color always" # `brew info hr`
# for vim
alias ctagshere="ctags -R -f .tags"
# large tables in a postgres db
# $ bigt <database_name> [postgres username]
function bigt {
if [ $# -gt 1 ]; then
user="-U$2"
elif [ "$PG_USER" != "" ]; then
user="-U$PG_USER"
else
user=""
fi
psql -d "$1" "$user" -c '\dt+' | egrep -e 'GB' -e " [0-9]{3,} MB"
}
# large indexes in a postgres db
# $ bigi <database_name> [postgres username]
function bigi {
if [ $# -gt 1 ]; then
user="-U$2"
elif [ "$PG_USER" != "" ]; then
user="-U$PG_USER"
else
user=""
fi
psql -d "$1" "$user" -c '\di+' | egrep -e 'GB' -e " [0-9]{3,} MB"
}