-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
51 lines (34 loc) · 1.91 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
#!/usr/bin/env bash
# Get week number
alias week='date +%V'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias locip="ipconfig getifaddr en0; ipconfig getifaddr en1"
# Clean up LaunchServices to remove duplicates in the “Open With” menu
alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
# Recursively delete `.DS_Store` files
alias cleanupFlash="find . -type f -name '*.DS_Store' -ls -delete"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Intuitive map function
# For example, to list all directories that contain a certain file:
# find . -name .gitattributes | map dirname
alias map="xargs -n1"
alias xcode="open -a Xcode"
alias finder="open ."
alias pi="(if [ -f './Gemfile' ]; then bundle exec pod install; else pod install; fi); tput bel"
# Launch Quake III
alias quake="/Applications/ioquake3.app/Contents/MacOS/ioquake3 +set r_fullscreen '0' +set r_customaspect '1' +set r_customwidth '1920' +set r_customheight '1000' +set r_mode '-1'"
# Notify. Usually used like `long-running-task; ntf` to show a notification after the task is done.
alias ntf="tput bel"
# Rebases TODO, isn't escaped
#alias finish_pr="git rev-parse origin/master | git branch --contains | egrep -v \"(^\\*|master|dev)\" | xargs git push origin --force && git rebase --onto `git symbolic-ref --short HEAD` --root master && git push master origin"
alias weather="curl wttr.in/Brno"
# JSON curl
alias jurl='curl -sLH "Content-Type: application/json"'
# Pretify JSON in clipboard.
alias jsonify='jq .'
alias pjson='pbpaste | jsonify'
alias tu='tuist'
alias git discard='git checkout --'