Skip to content

Instantly share code, notes, and snippets.

/* Container styles */
.container {
display: flex;
flex-wrap: var(--wrap, wrap);
flex-direction: var(--direction, row);
width: 100%;
margin: calc(var(--spacing, 0px) / -2);
box-sizing: border-box;
}
@kirkegaard
kirkegaard / toPablodraw.go
Last active September 17, 2025 20:36
converts this into something pablodraw will read: https://demozoo.org/graphics/370994/
package main
import (
"log"
"os"
)
func main() {
data, err := os.ReadFile("input.txt")
if err != nil {
@kirkegaard
kirkegaard / hexagon.c
Created September 10, 2025 15:17
Hexagons
#include <math.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#include <stdint.h>
#include <stdlib.h>
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 256
@kirkegaard
kirkegaard / iterator.js
Last active August 18, 2025 16:28
@cassidoo mailing list question
function createLaundryItem() {
let count = 0;
const tasks = [
"soak",
"wash",
"rinse",
"spin",
"dry",
];
@kirkegaard
kirkegaard / binpack.js
Created August 11, 2025 17:36
@cassidoo mailing list question
// To find the optimal groups we can use bin packing.
// https://en.wikipedia.org/wiki/Bin_packing_problem
const files = [120, 90, 60, 150, 80];
const maxDuration = 200;
function groupAudioFiles(files, maxDuration) {
// Sort files in descending order
const sorted = [...files].sort((a, b) => b - a);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>chat</title>
<style>
* {
box-sizing: border-box;
margin: 0;
@kirkegaard
kirkegaard / postmessages.html
Last active July 11, 2025 13:19
Send post messages back and forth between windows
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Window 1</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
@kirkegaard
kirkegaard / enable-akai-katana-and-dodonpachi-saidaiojou-in-mame.diff
Last active April 12, 2025 17:11
Enable Akai Katana and DoDonPachi SaiDaiOuJou in mame
diff --git a/src/mame/cave/cv1k.cpp b/src/mame/cave/cv1k.cpp
index c57694f92aa..14865cc0b5b 100644
--- a/src/mame/cave/cv1k.cpp
+++ b/src/mame/cave/cv1k.cpp
@@ -917,32 +917,32 @@ ROM_START( dfkbl )
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(31f9eb0a) SHA1(322158779e969bb321241065dd49c1167b91ff6c) )
ROM_END
-// ROM_START( akatana )
-// ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF)
const input = await Deno.readTextFile("input.txt");
type Position = { x: number; y: number };
type Direction = "up" | "down" | "left" | "right";
type Guard = {
position: Position;
direction: Direction;
};
@kirkegaard
kirkegaard / aoc_day05.ts
Created December 5, 2024 16:17
advent of code day 5
const input = await Deno.readTextFile("input.txt");
type Rule = {
x: number;
y: number;
};
const [order, pages] = input.split("\n\n");
function parseRules(rules: string): Rule[] {