Skip to content

Instantly share code, notes, and snippets.

View jdmichaud's full-sized avatar

jdmichaud

View GitHub Profile
@jdmichaud
jdmichaud / recreation.md
Created February 4, 2026 07:27
Game idea

Lemmings

Star Raiders II

@jdmichaud
jdmichaud / README.md
Created January 26, 2026 21:04
The Grand Master

THE GRAND MASTER

Genre: Historical Drama
Tone: Quietly tragic, observational, with subtle humour and moments of intensity
Languages: English and French (as appropriate)
Point of View: George Walker

CONTEXT

Set in 1834, The Grand Master tells the story of Alexander McDonnell and Louis-Charles Mahé de La Bourdonnais, two of the greatest chess players of their time. Despite living in opposite worlds and speaking different languages, they share a deep, unspoken connection through the chessboard, where their personalities are reversed:

@jdmichaud
jdmichaud / easy_query.rs
Created January 26, 2026 16:01
Rust sqlite easy query
use rusqlite::{Connection, Result, Params};
pub struct Query<'conn> {
stmt: rusqlite::CachedStatement<'conn>,
}
impl<'conn> Query<'conn> {
pub fn new(conn: &'conn Connection, sql: &str) -> Result<Self> {
Ok(Self { stmt: conn.prepare_cached(sql)? })
}
@jdmichaud
jdmichaud / consoleImage.js
Created January 21, 2026 07:21
Display image in the browser's console
(window as any).console.image = (canvas: HTMLCanvasElement, targetWidth?: number, targetHeight?: number) => {
const url = canvas.toDataURL();
const image = new Image();
image.src = url;
image.onload = () => {
// 1. Determine dimensions: Use target resolution if provided,
// otherwise default to the canvas's own dimensions.
const w = targetWidth ?? canvas.width;
const h = targetHeight ?? canvas.height;
@jdmichaud
jdmichaud / openstreetview.md
Last active January 21, 2026 21:08
Open Street View
@jdmichaud
jdmichaud / 1_scanimage.md
Last active January 18, 2026 15:36
scanimage notes

List devices:

scanimage --list-devices

Get device capability:

scanimage --help --device-name=brother4

Do not use /dev path here but the first part of the device string provided by the list devices command:

@jdmichaud
jdmichaud / chat.md
Created December 13, 2025 10:58
Vectors/Matrices in Zig

This is a very strong objection — and you’re right to push on it. Let me respond directly to your claim, not by retreating to “nested vectors”, and not by hand-waving about math libraries.

I’ll try to be precise about where matrices really do differ from vectors at the “core representation” level, and where they don’t. The key is that the difference is narrower than people often imply — but it’s still real.


1. You’re right about one big thing

“All this applied to vectors too.”

@jdmichaud
jdmichaud / notes.md
Created December 11, 2025 19:49
Video edit

Metadata

See metadata (and other data about the file):

ffmpeg -i input.mp4

Add metadata to video:

ffmpeg -i input.mp4 -metadata title="My Video Title" \
@jdmichaud
jdmichaud / main.js
Created December 4, 2025 16:23
Retrieve pixels of an image
const data = await (await fetch('Tv-test-pattern-146649_640.png')).bytes();
const decoder = new ImageDecoder({ type: "image/png", data });
const frame = await decoder.decode();
const bytes = new Uint8Array(frame.image.allocationSize());
await frame.image.copyTo(bytes.buffer);
@jdmichaud
jdmichaud / jit.c
Created November 26, 2025 18:07
jit
#include <sys/mman.h>
#include <string.h>
#include <stdio.h>
int main() {
/*
This is raw x86-64 machine code for a TINY *leaf function*:
lea eax, [rdi + 1] ; compute (arg + 1)