All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.
# run command in the foreground
command
# run commend in the background
| if ! (( $+commands[tmux] )); then | |
| print "zsh tmux plugin: tmux not found. Please install tmux before using this plugin." >&2 | |
| return 1 | |
| fi | |
| # ALIASES | |
| alias ta='tmux attach -t' | |
| alias tad='tmux attach -d -t' | |
| alias ts='tmux new-session -s' |
| # Updating OS | |
| sudo pamac checkupdates -a | |
| pamac upgrade -a --no-confirm | |
| # Installing tools and softwares | |
| pamac install | |
| \ tmux | |
| \ nvim | |
| \ docker | |
| \ docker-compose |
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
| // Simple gist to test parallel promise resolution when using async / await | |
| function promiseWait(time) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve(true); | |
| }, time); | |
| }); | |
| } |