-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.functions
70 lines (58 loc) · 1.33 KB
/
.functions
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
gkill ()
{
pname=$1;
formatted_pname="[${pname:0:1}]${pname:1}";
kill -9 $(ps aux | grep $formatted_pname | awk '{print $2}')
}
rdb ()
{
if [ -f ./bin/rake ]; then
local _rake="bin/rake";
else
local _rake="bundle exec rake";
fi;
$_rake db:migrate && $_rake db:test:prepare
}
vimgit() {
vim -O \
$(git diff --name-only) \
$(git diff --name-only --cached) \
$(git ls-files --others --exclude-standard)
}
vimflict () {
vim -p $(git diff --name-only --diff-filter=U)
}
vimrg () {
vim -c "/$1" -O $(rg -l $1)
}
ytb () {
y=$(date '+%Y%m%d%H%M%S')
t=$'\n[_] YTB\n'
b=$' Y:\n T:\n B:'
echo "$y$t$b" | pbcopy
echo "$y$t$b"
}
port () {
lsof -nP -i4TCP:$1 | grep LISTEN
}
most_recent_file () {
ls -t $1 | head -1
}
kash () {
kubectl -it exec $1 bash
}
top_down_migrate_timestamp () {
bin/rake db:migrate:status | grep "^ down" | head -n1 | tr -s ' ' | cut -d " " -f 3
}
copy_branch () {
git rev-parse --abbrev-ref HEAD | pbcopy
}
renew_certbot () {
sudo certbot certonly --server https://acme-v02.api.letsencrypt.org/directory \
--dns-digitalocean --dns-digitalocean-credentials ~/.ssl/credentials \
--dns-digitalocean-propagation-seconds 10 \
-d \*.devserv.dev
}
fb () {
RETAIL_PORT=3009 WEB_PORT=3001 DB_PORT=5434 REDIS_PORT=6380 bin/service start
}