-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.zsh
47 lines (35 loc) · 878 Bytes
/
helpers.zsh
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
function gcm() {
git checkout main
}
function gc() {
git checkout $1
}
function gcn() {
git checkout -b $1
}
function git-soft() {
git reset --soft HEAD~$1
}
function git-diff-file() {
git diff > changes.patch
}
function git-apply-diff-file() {
git apply $1
}
function get-pid() {
lsof -i :$1
}
function kill-pid() {
kill -9 $1
}
function kill-port() {
lsof -ti:$1 | xargs kill
}
function get-artifactory-token-from-yarnrc-yml() {
awk '/npmAuthToken/ {getline; print}' ~/.yarnrc.yml | tr -d ' ' | sed 's/^npmAuthToken: *//'
}
function get-fresh-artifactory-token() {
curl -u ${ARTIFACTORY_USER_NAME}:${ARTIFACTORY_API_KEY} -X POST ${ARTIFACTORY_BASE_URL}/artifactory/api/security/token -d "username=${ARITFACTORY_USER_NAME}" -d "scope=member-of-groups:readers"
}
alias projects="cd ~/Projects"
alias gitcreds="git credential-osxkeychain get"