Skip to content

Instantly share code, notes, and snippets.

View konsumer's full-sized avatar

David Konsumer konsumer

View GitHub Profile

To publish for M5 Loader/Burner, you need to merge your firmware:

esptool.py --chip esp32 merge_bin -o merged_firmware.bin --flash_mode dio --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin

you will see the log of the filenames and offsets when you run pio run -t upload

@konsumer
konsumer / github_verified.md
Created April 8, 2026 00:50
I want to just use my SSH key to have "Verified" commits on Github. This is a quick setup, on Mac.
ssh-keygen

git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
git config --global gpg.ssh.program /usr/bin/ssh-keygen

cat ~/.ssh/id_ed25519.pub
@konsumer
konsumer / add_duckdb_extension_footer.py
Created March 17, 2026 17:57
DuckDb native extensions require some footer-data. THis adds it to the the dynamic-lib.
@konsumer
konsumer / ThemeSelect.jsx
Last active December 12, 2025 10:18
Switches daisyui theme (body:data-theme). Optionally, it will follow user's media-preference, and persists their choice.
import { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik'
// switches daisyui theme (body:data-theme)
// optionally, it will follow user's media-preference, and persists their choice
export default component$(({ themeDark = 'dark', themeLight = 'light', useDarkPref }) => {
const theme = useSignal(true)
useVisibleTask$(() => {
if (localStorage.theme) {
document.body.dataset.theme = localStorage.theme
@konsumer
konsumer / android-store-definitions.md
Last active November 9, 2025 18:30
Android store device definition files
Name API Link
alps 875 (api19) 19 875
OPPO 1201 (api22) 22 1201
vivo 1601 (api24) 24 1601
vivo 1603 (api23) 23 1603
vivo 1606 (api23) 23 1606
vivo 1610 (api23) 23 1610
vivo 1716 (api25) 25 1716
vivo 1718 (api25) 25 [171
@konsumer
konsumer / d1_diff_migrate.sh
Last active November 7, 2025 00:47
Say you have a remote D1 database called "DB". You can run this to produce a diff-migration for structure.sql: `./d1_diff_migrate.sh feature1 DB structure.sql`, then run `npx -y wrangler d1 migrations apply DB`
#!/bin/bash
# this will create a D1 migration that diffs the current remote database
set -eo pipefail
if ! command -v npx &> /dev/null; then
echo "npx needs to be in your path." >&2
exit 1
fi
// for https://www.tztstore.com/goods/show-7983.html
// put this in Arduino/libraries/TFT_eSPI/
#define USER_SETUP_INFO "CYD"
#define ILI9341_2_DRIVER
#define TFT_INVERSION_ON
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
@konsumer
konsumer / .colors.sh
Created June 4, 2014 22:59
My setup for pretty colored git-oriented BASH prompt, looks like this with colors: konsumer@Davids-Mac-Pro ~/project (master) $
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@konsumer
konsumer / pi-gen.sh
Created July 8, 2025 21:43
Basic pi-gen config for arm64 pi image (lite)
git clone https://github.com/RPi-Distro/pi-gen.git
cd pi-gen
git checkout arm64
cat << EOF > config
IMG_NAME=nullos-pi-lite-bookworm-aarch64
PI_GEN_RELEASE="NullOS Pi"
RELEASE=bookworm
TARGET_HOSTNAME=nullos
KEYBOARD_KEYMAP=us
@konsumer
konsumer / fflatefs.js
Last active June 21, 2025 09:17
Stupidly-minimal fs that uses fflate on the zip. It's just enough to load js carts, and read files, but not much else.
// stupidly-minimal fs that uses fflate on the zip
// it's just enough to load js carts, and read files, but not much else
import * as fflate from 'fflate' // https://esm.sh/fflate/esm/browser.js
const FILETYPE_REGULAR_FILE = 4
const FILETYPE_DIRECTORY = 3
export default async function fflatefs(cartUrl) {
const info = {}