Skip to content

Instantly share code, notes, and snippets.

/**
* Firmware for my 5 keys + 1 encoder macropad
* Link: https://photos.strangeplanet.fr/index.php?/category/269-macropad_mai_2026
*
* Supports multiple profiles.
* The encoder is used to switch profile and configure the colors
* (long press: brightness -> short press: color 1 -> short press: color 2 -> short press: idle)
*
* BOM:
* - RP2040 Zero
; AutoIt script to automatically move downloaded files of a certain extension to another folder
#include <WinAPIFiles.au3>
#include <WinAPIMisc.au3>
#include <APIFilesConstants.au3>
Local $sourceDir = "A:\Downloads\"
Local $destDir = "\\NAS\downloads\"
Local $extension = ".torrent"

TrueNAS Immich cloud backup

This is a way to do an automated cloud backup of your Immich database using TrueNAS Cloud Sync Tasks.

  1. Create a PUSH+SYNC task and selected your prefered cloud remote
  2. Select /<immich-dataset>/backups as source
  3. Add a pre-script to create the backup
    curl -H "Content-Type: application/json" \

-H "x-api-key: " \

TrueNAS Jellyfin cloud backup

This is a way to do an automated cloud backup of your Jellyfin database using TrueNAS Cloud Sync Tasks. Requires Jellyfin 10.10 or above.

  1. Create a PUSH+SYNC task and selected your prefered cloud remote
  2. Select /<jellyfin-dataset>/data/backups as source
  3. Add a pre-script to create the backup
    curl -H "Content-Type: application/json" \

-d '{"Database":true,"Metadata":false,"Trickplay":false,"Subtitles":false}' \

@mistic100
mistic100 / ha_jellyfin_nowplaying.yaml
Last active March 19, 2026 20:43
[Home Assistant] Jellyfin "now playing" sensor
# Creates a binary sensor with the name and type of the currently playing item as attributes
# Replace <SERVER_ADDRESS>, <API_KEY> and <USERNAME>
- sensor:
name: "Jellyfin NowPlaying"
scan_interval: 30
command: >-
curl http://<SERVER_ADDRESS>/jellyfin/Sessions\?ApiKey\=<API_KEY> | jq '
(.[] | select(.UserName == "<USERNAME>") | select(.NowPlayingItem) | select(.PlayState.IsPaused == false)) // {}
| {
@mistic100
mistic100 / lil-gui-textarea.ts
Last active June 15, 2025 10:18
[JS] Add textarea support to lil-gui
import { GUI, Controller } from 'lil-gui';
export class TextController extends Controller {
private $button: HTMLButtonElement;
private $text: HTMLTextAreaElement;
constructor(parent: GUI, object: object, property: string, rows: number = 4) {
super(parent, object, property, 'textarea');
@mistic100
mistic100 / lil-gui-jscolor.ts
Last active June 15, 2025 10:18
[JS] Use jscolor.js library inside lil-gui
import { GUI, Controller } from 'lil-gui';
import '@eastdesire/jscolor';
export class ColorController extends Controller {
private $input: HTMLInputElement;
private picker: any;
constructor(parent: GUI, object: object, property: string, alpha: boolean | 'auto' = 'auto') {
super(parent, object, property, 'color');
@mistic100
mistic100 / qbitorrent-port.au3
Last active July 27, 2024 17:15
Starts qBitorrent after prompting for the listening port
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
$exeFile = "C:\Program Files\qBittorrent\qbittorrent.exe"
Opt("TrayIconHide", 1)
GUICreate("qBitorrent", 200, 75, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP, $WS_CAPTION))
GUISetFont(12, 400, 0, "Segoe UI")
  1. generate palette
ffmpeg -y -i video.webm -vf palettegen=max_colors=64 palette.png
  1. convert
ffmpeg -y -i video.webm -i palette.png -filter_complex paletteuse=dither=bayer:bayer_scale=1 -r 15 output.gif
ffmpeg -i video.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr -qscale:v 2 still-%02d.jpg