Skip to content

Instantly share code, notes, and snippets.

@snacsnoc
snacsnoc / blkenvflash
Last active December 22, 2025 20:04 — forked from Spiritdude/blkenvflash
LuckFox Pico Pro/Max SD card writer from .env.txt
#!/usr/bin/env python3
# blkenvflash_mac_pwrite.py — fast Luckfox TF writer (macOS), uses pwrite()
# fork of BLKENVFLASH by Rene K. Mueller <spiritdude@gmail.com>
# License: MIT
#
# History:
# 2024/06/18: after the hint by A. Schuetz https://github.com/LuckfoxTECH/luckfox-pico/issues/129 was able to make script functional
# 2024/06/10: start
@snacsnoc
snacsnoc / load_dg_coupons.py
Created May 24, 2025 16:22
Load Dollar General coupons from file (JSON) and apply to account
#!/usr/bin/env python3
# load_dg_coupons.py
import argparse, json, sys, textwrap
from pathlib import Path
from urllib.parse import urlencode
import requests
# ---------- constants you normally NEVER edit in-file ----------
BASE = "https://www.dollargeneral.com/bin/omni/coupons"
@snacsnoc
snacsnoc / dg_clip_all.py
Created May 24, 2025 16:19
Dollar General coupon loader via API
#!/usr/bin/env python3
"""
Dollar General – clip **everything** that is currently visible in
‘Digital Coupons’.
USAGE
DG_COOKIE="Paste the long Cookie header here" \
python3 dg_clip_all.py
"""
import json, os, sys, time, urllib.parse, requests
@snacsnoc
snacsnoc / download_dem_bc_files.py
Created October 9, 2024 08:46
Download all Digital Elevation Models for British Columbia - CDED - 1:250,000
import os
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin
# Base URL for the dataset
# See https://catalogue.data.gov.bc.ca/dataset/digital-elevation-model-for-british-columbia-cded-1-250-000
BASE_URL = "https://pub.data.gov.bc.ca/datasets/175624/"
# Local folder to save the downloaded files
@snacsnoc
snacsnoc / deep-live-cam-easton-setup.md
Last active August 13, 2024 18:09
Setting up Deep Live Cam on Mac OS - Optimizations

By using a different model and tuning Deep Live Cam, we can go from 1-2 frames per second to ~16 frames per second when rendering video.

Clone

git clone https://github.com/hacksider/Deep-Live-Cam

Create venv (python 3.11 no work due to numpy dependencies)

@snacsnoc
snacsnoc / backup-applets.sh
Created July 30, 2024 06:39
Backup all AlphaSmart Neo (2) applets with neotools
#!/bin/bash
# Fetch the list of applets and save the JSON output to a temporary file
sudo neotools applets list > applets.json
sleep 10
jq -c '.[]' applets.json | while read -r applet; do
applet_id=$(echo "$applet" | jq '.applet_id')
# sanitize name for filename
applet_name=$(echo "$applet" | jq -r '.name' | sed 's/[^A-Za-z0-9_]/-/g')
@snacsnoc
snacsnoc / m68k_dev_setup.sh
Last active May 10, 2024 08:12 — forked from WillSams/m68k_dev_setup.sh
Setup for Motorola 68000 (m68k) Cross Compiler on Debian-based System
#!/bin/bash
echo "==================================================================="
echo
echo " My m68000 Development Setup "
echo " You may be prompted for root credentials to complete the install. "
echo
echo " Toolchain is GNU so it expects you to write AT&T style assembly. "
echo " If you want the Windows (MSYS2) script, it's here: "
echo " https://gist.github.com/WillSams/f592f9d494b51119945440f7e91079b0 "
import os
from typing import Tuple
class DeviceManager:
def __init__(self):
self.devices = {}
def register_device(self, device_name, block_size):
"""Register a device with the given name and block size"""