-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc##class.Work
56 lines (47 loc) · 1.95 KB
/
.zshrc##class.Work
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
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# Don't change the below 3 rows order...
export ZSH=/Users/peterlukacs/.oh-my-zsh
ZSH_THEME="af-magic"
source $ZSH/oh-my-zsh.sh
# enable zsh-completions
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
plugins=(
zsh-completions autojump
)
# Aliases
alias zshconfig="code ~/.zshrc"
alias hotkeys="code /Users/peterlukacs/.hammerspoon/"
alias command-hints="cat ~/.command-hints.md"
alias restart-shell="zsh -l"
alias dil='docker image ls'
alias dip='docker image prune -f'
alias dp='docker ps'
# Komoot
alias tunnel='local expiration_time=$(find ~/.aws/sso/cache/ -type f -name "*.json" -exec grep -q '"accessToken"' {} \; -exec grep -q '"expiresAt"' {} \; -exec jq -r '.expiresAt' {} + | sort -r | head -n 1); if [ -z "$expiration_time" ] || [ "$(date -j -u -f "%Y-%m-%dT%H:%M:%SZ" +%s "$expiration_time")" -lt "$(date +%s)" ]; then aws sso login; fi; ssh -L 5439:main.ci6pf3wvc9tf.eu-west-1.redshift.amazonaws.com:5439 komoot-analytics-ssh-jump-host -N -o ServerAliveInterval=60'
# pyenv for python version management
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# autojump
[ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh
# disable Chrome's two/three finger 'go back/forward' navigation
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE
# countdown timer (cdt)
function cdt(){
local now=$(date +%s)
local end=$((now + $1))
while (( now < end)); do
printf "%s\r" "$(date -u -j -f %s $((end - now)) +%T)"
sleep 0.25
now=$(date +%s)
done
printf "%s\r" "$(date -u -j -f %s $((end - now)) +%T)"
echo
echo -en "\a"
}
### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT)
export PATH="/Users/peterlukacs/.rd/bin:$PATH"
### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT)