-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
executable file
·80 lines (69 loc) · 2.22 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
# oh-my-zsh
alias zshconfig="$EDITOR ~/.zshrc"
alias ohmyzsh="$EDITOR ~/.oh-my-zsh"
alias reload="source ~/.zshrc"
# development
alias server="python -m SimpleHTTPServer"
alias serveo="ssh -R 80:localhost:3000 serveo.net"
# https://paulbrowne.xyz/https-localhost
alias https-server='http-server --ssl --cert ~/.ssl/localhost.crt --key ~/.ssl/localhost.key -a localhost -o'
# npm
alias npm-i='npm install'
alias npm-is='npm install --save'
alias npm-id='npm install --save-dev'
alias npm-ig='npm install --global'
alias npm-start='npm start'
alias npm-test='npm test'
alias npm-it='npm install && npm test'
alias npm-lk='npm link'
alias npm-run='npm run'
alias npm-reset='rm -rf node_modules && rm -f package-lock.json && npm install && npx node-notifier-cli -t "Done" -m "npm modules reinstalled" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png'
alias npm-ri='rm -rf node_modules && npm i'
# npx
alias commit="npx git-cz"
alias react_app="npx create-react-app"
# mac
alias hd="cd /Volumes/HD"
alias work="cd /Volumes/HD/Workspace"
alias learn="cd /Volumes/HD/Learning"
alias shutdown="sudo shutdown -h now"
alias hosts="sudo $EDITOR /etc/hosts"
alias dns_clear="dscacheutil -flushcache"
# directory
alias downloads='cd ~/Downloads/'
# mv, rm, cp
alias mv='mv -v'
alias rm='rm -i -v'
alias cp='cp -v'
alias md="mkdir"
alias rd="rmdir"
alias del="rm -i"
# Easier navigation: .., ..., ~ and -
alias cl="clear"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# git
clone() {
git clone $1
cd $(basename ${1%.*})
if test -f "./package.json"; then
echo "..."
echo "Found package.json... installing dependencies"
echo "..."
npm install
fi
}
# docker
alias dockercleand='docker rmi $(docker images -q)' #delete all images
alias dockercleanu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images
alias dockercleans='docker rm $(docker ps -a -q)' #delete all stopped images
alias dockerstop='docker stop $(docker ps -aq)' #stop all container
alias dcu='docker-compose up' #start with docker-composer
# others
alias fs="stat -f \"%z bytes\""
alias chmox='chmod -x'
alias where=which