Skip to content

Instantly share code, notes, and snippets.

View benkant's full-sized avatar

Ben Giles benkant

View GitHub Profile
@benkant
benkant / browser.md
Last active March 19, 2024 02:31
Debugging Chromium on Linux

Use the following to get runtime logs:

browser() {
    chromium-browser --ozone-platform=wayland --enable-features=UseOzonePlatform,VaapiVideoDecoder --allow-sandbox-debugging --enable-logging=stderr --v=1 "$@"
}

After enabling coredumps (see instructions here), test chromium dumps cores to /var/coredumps:

@benkant
benkant / insights_and_wisdom.md
Created February 13, 2025 06:08
Mike Lolan's Lost Weekend

Mike Nolan's Long Weekend

IDEAS

  • A good mate, Les, who once took part in wild “skits missions,” is remembered for passing away while doing what he loved, setting a bittersweet tone throughout the series.
  • The group’s street footy game is run by fluid, on-the-spot rules—whether it’s debating if a kicked ball must be returned regardless of the distance or arguing over the possibility of a re-kick when something gets in the way.
  • There's a constant interplay between gravity and levity: heavy themes like loss and past adventures mix with the triviality of waiting for online deliveries or a casual kickabout.
  • Nolan’s anticipation for the “coolest drill” he ordered online (with delivery expected in two to three business days) is a recurring, mundane yet meaningful subplot.
  • The characters play a game while self-documenting their escapades, with Nolan filming their interactions in a tongue-in-cheek, documentary style.
  • The dialogue—laced with casual, explicit Aussie slang—reinforces a uniquely local and
@benkant
benkant / audio-processor.js
Created April 16, 2025 16:22
AudioWorklet processor
// audio-processor.js
// This AudioWorkletProcessor receives audio input and sends the raw Float32 data to the main thread.
class AudioProcessor extends AudioWorkletProcessor {
process(inputs, outputs, parameters) {
// 'inputs' is an array of arrays; assume the first input and first channel (mono input).
if (inputs.length > 0 && inputs[0].length > 0) {
const channelData = inputs[0][0]; // This is a Float32Array of audio samples.
// Create a copy of the data.
const audioChunk = new Float32Array(channelData);
// Post the audio chunk to the main thread.