Skip to content

Instantly share code, notes, and snippets.

View protiumx's full-sized avatar

Brian Mayo protiumx

View GitHub Profile
@protiumx
protiumx / script-template.sh
Created November 22, 2022 22:03 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@protiumx
protiumx / template.sh
Created October 31, 2022 09:51
Bash script template
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
@protiumx
protiumx / kitty.conf
Created December 25, 2021 22:30
Kitty Configuration for iTerm users
# vim:fileencoding=utf-8:foldmethod=marker
# Include theme
include ./theme.conf
# ===== Config =====
font_family CaskaydiaCove Nerd Font
font_size 16.0
@protiumx
protiumx / retrieveUsers.js
Created January 18, 2019 00:31
retrieveUsers.js
const users = {}
function node(key, value) {
this.next = null
this.prev = null
this.key = key
this.value = value
}