Skip to content

Instantly share code, notes, and snippets.

View matchaxnb's full-sized avatar

Matcha matchaxnb

View GitHub Profile
@matchaxnb
matchaxnb / export-tilemap-to-gbasm.lua
Last active December 24, 2025 03:59
Aseprite: export tilemap to GBASM format
-- Author: Matcha, with some work from Anon of the referenced Pastebin
-- Author URL: https://hamac303.eu/
-- Put in your .config/aseprite/scripts folder
-- Use by selecting your tilemap layer (not your tileset)
-- This targets the clipboard, for simplicity
-- License: WTFPL
local debugArray = {}
local ERROR_COLOR = 536870911 -- this is a color value returned in some error cases
local enableDebug = false
@matchaxnb
matchaxnb / text_algebra.py
Last active September 19, 2025 15:34
Text Algebra in python
#!/usr/bin/env python
# License: CC-0
"""text_algebra: a stack-based RPN line-matching toolkit
Usage: text_algebra [--repl|-f your-program.txt|your inline program]
--repl starts a REPL to work interactively.
-f your-program.txt will load a (possibly multi-line) program
Definitions:
Operators: U N D S X C F P R (see examples)
Operands: anything else will be considered as filenames and read as
@matchaxnb
matchaxnb / Makefile
Last active August 5, 2025 11:50
hamac303's minimal template engine
.PHONY = (all)
all: ../index.html
../index.html: index.html.tpl *.md *.css
./templatize index.html.tpl ../index.html
; i'll update this from time to time
; add this to your prelude file
; i am under the assumption that you keep the original prelude contents
\pitchLogIndex [ pitchLogIndex 2^ ] = toHz
\midinum [
; first produce a pitch log index based on C4==60
midinum 60 - ; this is the distance to C4
1/12 * C4 + ; this is the pitch log index for the note
toHz ; we convert it
@matchaxnb
matchaxnb / midimix.control.js
Created April 29, 2025 12:14
Control script for Midimix (slightly improved)
/* just temporarily posting it here until i make a pull request */
loadAPI(18)
host.defineController("Akai", "Akai Midimix", "0.1", "7b8cd61c-2718-4d77-80b5-a2103f92b69c", "mfeyx")
host.addDeviceNameBasedDiscoveryPair(["MIDI Mix"], ["MIDI Mix"])
host.defineMidiPorts(1, 1)
/* ------------------------------------------------------ */
/* DEBUGGING FEATURE */
/* ------------------------------------------------------ */
@matchaxnb
matchaxnb / Instructions.md
Created March 27, 2025 08:04
Instructions TD tests webdev

Script pour créer l'appli

# possiblement besoin d'utiliser une version récente de node
nvm use v22.14.0
# pour créer l'appli
npx create-react-app notes-app
cd notes-app
npm install react-router-dom cypress --save
@matchaxnb
matchaxnb / decode_hexspeak.py
Last active March 26, 2025 10:46
A set of utilities for drones of all kinds
#!/usr/bin/env python
import sys
zero = '⬡'
one = '⬢'
dronemap = {
'0': zero,
'1': one,
}
@matchaxnb
matchaxnb / GUIDE.md
Created February 23, 2025 15:29
Start squeezelite as a Windows service with reduced privileges
@matchaxnb
matchaxnb / lc.py
Last active July 30, 2024 12:01
Line and char counter
#!/usr/bin/env python
"""lc: a linecounter. reads stdin and prints advancement in numbers of chars/lines
Usage:
lc -l INTERVAL [--thru]
lc -c INTERVAL [--thru]
Options:
-l INTERVAL output a message every INTERVAL lines [default: 100]
-c INTERVAL output a message every INTERVAL characters [default: 100]
@matchaxnb
matchaxnb / binary_search_stuff.py
Created December 19, 2023 22:28
binary search stuff, for fun
"""we play with large sorted integer arrays"""
import timeit
from typing import Union, Tuple
import random
ar_a = list(range(0, 10))
ar_b = list(range(-5, 5, 1))
ar_c = list(range(-100, 100))
ar_d = list(range(90, 101))