Skip to content

Instantly share code, notes, and snippets.

View jonathanfann's full-sized avatar

Jonathan Fann jonathanfann

View GitHub Profile
@jonathanfann
jonathanfann / .zshrc
Last active April 29, 2024 13:22
Get current ticket from branch name and return with commit message in ZSH
function doCommit() {
local branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
local ticket=""
if [[ $branch != "" ]];
then
local parts=(${(@s[-])branch})
local part1=$parts[1]
local part2=$parts[2]
ticket="$part1-$part2"
fi
@jonathanfann
jonathanfann / main.py
Last active May 15, 2025 14:28
Connect Pico to wifi and AHT20 Temperature & Humidity Sensor via i2C and Serve as JSON
import os
from microdot import Microdot
import network
from time import sleep
from machine import Pin, I2C
import json
from picozero import pico_led
import ahtx0
@jonathanfann
jonathanfann / main.py
Last active July 8, 2025 14:20
Raspberry Pi Pico 2W Temp Sensor Server (MicroPython)
import os
from microdot import Microdot
import network
from time import sleep
from machine import Pin, I2C, reset
import json
from picozero import pico_led
import gc
import ahtx0
@jonathanfann
jonathanfann / regenerate_all_playlists.py
Created February 10, 2026 18:51
Generate Chronological Discography for Plex Folders
#!/usr/bin/env python3
"""
Complete playlist regeneration and upload to Plex.
Creates chronological playlists from music directories and uploads them to Plex,
cleaning up old uploaded playlists first.
Usage:
python regenerate_all_playlists.py
Edit the MUSIC_FOLDERS list below to specify which directories to process.