Skip to content

Instantly share code, notes, and snippets.

View nitefood's full-sized avatar

Adriano nitefood

  • Italy
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active November 15, 2024 11:25
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...]
@niedzielski
niedzielski / pretty-print-json.js
Last active July 3, 2023 03:27
Pretty print JSON bookmarklet.
javascript:(_ => {
const pre = document.querySelector('pre');
pre.innerHTML = JSON.stringify(JSON.parse(pre.innerHTML), null, 2);
})()