-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
executable file
·165 lines (133 loc) · 4.97 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#############################################################
# System
#############################################################
# Etc
alias cls="clear"
alias stopport="_killPort"
alias cs="_cheatsheet"
alias nosleep="caffeinate -t 36000"
alias testsslciphers="_testSSLCiphers"
alias killgpg="gpgconf --kill gpg-agent"
alias emptytrash="sudo rm -rf ~/.Trash/*"
alias extract="_extract"
alias showhidden="defaults write com.apple.Finder AppleShowAllFiles true && killall Finder"
alias hidehidden="defaults write com.apple.Finder AppleShowAllFiles false && killall Finder"
# Tuxera gives us 15 days trials. We can extend it by removes it's app then install it again.
alias rmtuxera="sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app && sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS && sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs"
alias image-tool="_imageTools"
alias video-tool="_videoTools"
alias kill-chrome-headless="pgrep chromedriver | xargs kill"
alias kill-chrome="pgrep -x 'Google Chrome' | xargs kill"
alias purge-appstore-cache="rm -rf ~/Library/Caches/store*"
# PHP
alias restartphp="brew services restart php73"
# IDEA
alias idea="_idea"
# ZSH
alias emptyhistory="echo '' > ~/.zsh_history"
alias zshfresh="source ~/.zshrc"
# SSH
alias cpsshkey="pbcopy < ~/.ssh/id_rsa.pub"
weather() { curl -4 wttr.in/${1:-~Sleman}?lang=id }
#############################################################
# Software Developer
#############################################################
# Python
alias py-nve="pyenv virtualenv"
alias py-act="pyenv activate"
alias py-list="pyenv virtualenvs"
alias py-rjn="jupyter notebook"
alias pip-upgrade="pip install -U pip"
### Django
alias dj="_django_commands"
alias dj-new="django-admin startproject"
alias dj-cls="python manage.py collectstatic"
alias dj-celery="_runCelery"
# Mysql
alias mysql="mysql -u root -p"
alias mysql_list_db="mysql -u root -p -e 'SHOW DATABASES'"
alias mysql_create_db="mysqladmin -u root -p create"
alias mysql_drop_db="mysqladmin -u root -p drop"
alias mysql_import_db="_mysqlImportDB"
alias mysql_drcr_db="_mysqlDropCreate"
# Javascript
## NodeJs
alias npm-start="npm start -- --reset-cache"
alias npm-start-andro="adb reverse tcp:8081 tcp:8081 && npm start -- --reset-cache"
## React Native
alias rn="react-native"
alias rn-andro="rn run-android"
alias rn-ios="rn run-ios --simulator=\"iPhone 7\""
## NuxtJs
alias nx-dev="rm -rf .nuxt/ build/ > /dev/null 2>&1 && yarn dev"
# PHP
## Etc
alias runserv="_runPHPServer"
alias phpini="idea /usr/local/etc/php/7.3/php.ini"
alias phpunit="./vendor/bin/phpunit"
alias behat="./vendor/bin/behat"
alias pu="php -c ~/.disable-xdebug.ini vendor/bin/phpunit"
alias puf="pu --filter "
## Composer
alias csr="_composerCheat"
## Wordpress
alias wprun="wp server --docroot=web --port=8000"
## Laravel
alias art="php artisan"
alias genCtag="ctags -R --languages=php"
alias l-fresh="composer dump-autoload && art clear-compiled && art cache:clear && art view:clear && art config:clear && art route:clear"
alias l-cache="art view:cache && art route:cache && art config:cache"
alias phpcscheck="~/.composer/vendor/bin/phpcs --standard=PSR2 app/"
alias phpcsfixer="~/.composer/vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format udiff"
alias l-queue="art queue:work --sleep=1 --tries=2 --queue=high,medium,low"
alias l-sc="art schedule:run"
alias l-sc-lo="art cache:clear && while true; do l-sc; sleep 15; done"
alias l-mfs="art migrate:fresh --seed"
alias l-sdp="art db:seed --class='PreliminaryDataSeeder'"
alias l-fxs="sudo chown -R __USERNAME__: storage/ && sudo chmod -R ug+rwx storage/ && sudo chmod 0660 storage/oauth*"
## Lumen
alias lumenfresh="composer dump-autoload && art cache:clear"
## Redis
alias redisrm="redis-cli flushall"
# Java || Scala
## Activator & SBT
alias act="activator"
alias actn="act new"
# DevOps
## Docker
alias docker="_runDocker"
alias run-kali="docker run -t -i kalilinux/kali-linux-docker /bin/bash"
# Android
alias genkeystore="_generateAndroidKeystore"
alias genapk="./gradlew assembleRelease"
alias myandro="$ANDROID_HOME/tools/emulator -avd Nexus_5X_API_25_x86 -netspeed full -netdelay none"
# C++
alias compile='_compileCpp'
# Git
alias gd-ep="gd -- . ':!public'" # git diff except public folder.
alias gcmc="_gitCommitCount" # get commit counts
alias gda="gd HEAD"
alias gitcheat="cat ~/.oh-my-zsh/plugins/git/git.plugin.zsh | grep"
alias gmauh="git merge --allow-unrelated-histories"
alias gresetfile="git checkout HEAD -- $1" # reset changes to a file
alias gdlcm="git diff HEAD^ HEAD" # git diff with last commit
alias gdiff='function _gdiff() {
branch=$1
file=$2
origin=$3
if [[ -z $branch ]]; then
branch="master"
fi
if [[ -z $origin ]]; then
origin="origin"
fi
git diff $origin/$branch:./ -- $file
};
_gdiff'
alias gresetmerge="git reset --hard HEAD~1"
#############################################################
# ETC
#############################################################
### Intellij IDEA
alias ngrok="_runngrok"
alias sf="_searchFileInFolder"