Skip to content

Instantly share code, notes, and snippets.

@soerface
soerface / jless.sh
Created March 10, 2020 23:09
jless
# Just put this in your ~/.zshrc or ~/.bashrc!
# Pretty format of json files. Usage: jless path/to/file.json
function jless {
python -mjson.tool "$1" | pygmentize -l json | less -Nr
}
@soerface
soerface / config.json
Last active June 21, 2020 11:01
flipdot-mqtt-dash-config
[
{
"iconOff": "ic_power_settings_new",
"iconOn": "ic_power_switch",
"offColor": -10461088,
"onColor": -65536,
"payloadOff": "0",
"payloadOn": "1",
"enableIntermediateState": true,
"enablePub": true,
@soerface
soerface / main.py
Created July 6, 2022 14:03
logging.basicConfig
import logging
logging.basicConfig(
format="%(asctime)s %(levelname)s: %(message)s",
level=logging.getLevelName("INFO"),
)
logger = logging.getLogger()
@soerface
soerface / compress.sh
Created July 6, 2022 17:01
Strong compression
tar -cf - INPUT_DIR | xz -0e -c > OUTPUT_FILE.tar.xz
@soerface
soerface / Caddyfile
Created October 21, 2024 00:14
Caddy workaround for Keycloak 25 CORS issue with Swagger UI
example.com {
reverse_proxy keycloak:8080 {
# https://github.com/keycloak/keycloak/issues/12682
# x-csrftoken is set by the Swagger UI
header_down +Access-Control-Allow-Headers "x-csrftoken"
}
}