forked from lewagon/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
227 lines (146 loc) · 4.43 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Get External IP / local IPs
alias ip="curl ipinfo.io/ip"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias speedtest="wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip"
#Python
# Quickly serve the current directory as HTTP
alias serve='ruby -run -e httpd . -p 8000' # Or python -m SimpleHTTPServer :)
#pyton vitual env activated Le Wagon
alias penv='pyenv activate lewagon'
#open jupyter notebook
alias jnote='jupyter notebook'
#kill port processes
alias kp='npx kill-port' #<PortNumber>
#List running server
alias wsr='lsof -nP +c 15 | grep LISTEN'
# Server port 3000
alias s3='rails s'
# Server port 4000
alias s4='rails s -p 4000'
# Server port 5000
alias s5='rails s -p 5000'
# Server port 6000
alias s6='rails s -p 6000' s
# Server port 7000
alias s7='rails s -p 7000'
# Server port 8000
alias s8='rails s -p 8000'
# Webpack compile
alias wpc='webpack-dev-server'
#open ngrok
Alias ngrok='./ngrok'
# Ruby
alias ru='ruby cd \"${fileDirname}\"\u000D'
# RoR
# rails db:drop
alias rdd='rails db:drop'
# rails db:create
alias rdc='rails db:create'
# rails db:migrate
alias rdm='rails db:migrate'
# rails db:seed
alias rds='rails db:seed'
# rails db:seed db:create db:migrate
alias rdb='rdd rdc rdm'
#Push your code to Heroku
alias gph='git push heroku master'
alias hpass='git push chateaupass master'
alias hdm='heroku run rails db:migrate --app chateaupass'
alias hrc='heroku run rails c --app chateaupass'
alias hlogs='heroku logs --tail --app chateaupass'
# GIT
# remove .git
alias rmgit='rm -rf .git'
#git create repo + ignore DS_Store
alias repo='git init; hub create -p; find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch;echo .DS_Store >> .gitignore;git add .gitignore;git commit -m ".DS_Store banished!";git push origin master; ga; comthis "first push on repo"; gor'
#git generic commit
alias nocom='ga;comthis "generic commit either for test purpose or just lasy...";gor'
#git ignore DS_Store
alias ds=' find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch;echo .DS_Store >> .gitignore;git add .gitignore;git commit -m ".DS_Store banished!";git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
#git remote remove origin
alias grr='git remote remove origin'
#git log --oneline
#alias com='git log --oneline'
#or
alias com='git lg'
# git fetch
alias gf='git fetch'
# git pull
alias gp='git pull'
# git fetch then pull
alias gfp='gf; gp'
# git add .
alias ga='git add .'
#git commit -m ....
alias comthis='git commit -m'
#Git add/status/commit with question prompt in terminal
function gcom() {
git add .
gst
read REPLY\?"Type commit => "
print ""
print ">> commit is: \"${REPLY}\""
print ""
git commit -m "${REPLY}"
}
#Git add/status/commit/push with question prompt in terminal
function cg() {
git add .
gst
read REPLY\?"Type commit => "
print ""
print ">> commit is: \"${REPLY}\""
print ""
git commit -m "${REPLY}"
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
print ""
print ">> Git STATUS after commit and push origin:"
print ""
gst
}
# git status then git add . then git status
function gsa() {
gst
ga
gst
}
#git checkout master
alias gcm='git checkout master'
#git checkout branch
alias gcb='git checkout'
# git push origin
alias gpo='git push origin'
#git push origin ....
alias gor='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
#reset git ignore
alias resig='git rm -r --cached .; git add .; git commit -m "fixed untracked files"; gst'
#LOCAL
# Show alias file content in terminal
alias al='cat /Users/cez/code/AzCez/dotfiles/aliases'
# open in visual studio
alias vsc='open . -a "Visual Studio Code"'
# go to Local to CODE folder
alias codef='cd /Users/cez/code'
# go to code folder in cloud
alias icloud='cd /Users/cez/Library/Mobile\ Documents/com~apple~CloudDocs'
# go to mobeetravel folder in cloud
alias mt='cd /Users/cez/Library/Mobile\ Documents/com~apple~CloudDocs/code/Mobeetravel'
#ZSH test
function vnc() {
open vnc://"$USER"@"$1"
}
function question() {
git add .
gst
read REPLY\?"Type commit =>"
print ""
print ">> commit is: ${REPLY}"
print ""
git commit -m "${REPLY}"
}
#ZSH Interpolation
#TMP=" hello ${:-=cat}"
#$ TMP="${:-=cat}"
#$ print -rl -- $TMP
#=>cat
# question code snippet : #read -q "REPLY?Enter COMMIT?"