Skip to content

Instantly share code, notes, and snippets.

@JanDW
JanDW / carnival-2025-pull-list.md
Last active October 10, 2025 17:40
Checklist of carnival games and their parts to be pulled from the barn for Carnival 2025.

🎡 carnival 2025 “pull from barn”

▢ pirate fishing (deep sea fishing)

  • 3 swim pools
  • "fish" with washers
  • satin cloth "water"
  • 6 magnetic fish poles[^1]
  • sea decorations
  • instructions for volunteers
@JanDW
JanDW / web-component.js
Created January 16, 2025 23:00
Web component boilerplate with lifecycle callbacks.
class MyElement extends HTMLElement {
// Fires when an instance of the element is created or updated
constructor() {
super();
}
// Fires when an instance was inserted into the document
connectedCallback() {
}
return {
fileName: gpxFile,
// gpxString: gpxStringClean,
trkName,
totalDistance: totalDistance.toFixed(2),
startWaypoint: {
name: startWaypoint.getElementsByTagName('name')[0]?.textContent,
lat: startWaypoint.getAttribute('lat'),
lon: startWaypoint.getAttribute('lon'),
ele: startWaypoint.getElementsByTagName('ele')[0]?.textContent,

Remco the Betta not doing great

Tank + Creatures

On Nov 13, 2023, I set up this 10 gallon dirted, sand-capped, and planted tank. I don’t vacuum the sand.

Contains:

  • a Betta, added Nov 25. Currently sick.
@JanDW
JanDW / aspect-ratio-layout-2.html
Created November 10, 2023 02:32
Using parent CSS selector (:has()) to target the desired layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Container Queries Javascript II</title>
<body>
<main>
<style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Container Queries Javascript</title>
<body>
<main>
<style>
*,
@JanDW
JanDW / Untitled-1
Created September 22, 2022 18:34
Section instance consistently fails to render in page editor
instrument.ts:129 TypeError: Cannot read properties of undefined (reading 'label')
at Select.tsx:28:73
at Ru (react-dom.production.min.js:262:359)
at t.unstable_runWithPriority (scheduler.production.min.js:18:343)
at Wo (react-dom.production.min.js:122:325)
at Au (react-dom.production.min.js:261:308)
at gu (react-dom.production.min.js:243:50)
at react-dom.production.min.js:123:115
at t.unstable_runWithPriority (scheduler.production.min.js:18:343)
at Wo (react-dom.production.min.js:122:325)
@JanDW
JanDW / outliner-snippet.js
Last active September 23, 2022 13:47
Applies outline and background-color in order to more readily understand layouts.
if (!document.querySelector("#debugStyles")) {
const style = document.createElement("style");
style.setAttribute("id", "debugStyles");
style.innerHTML = `
.debug-boxes * {
outline: 1px solid blue;
background-color: rgba(0,255,255,.05);
}
`;
document.head.appendChild(style);
function shuffleArray(arr) {
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[arr[i], arr[j]] = [arr[j], arr[i]];
}
}
const montyHall = (n) => {
let wins = 0;
let doors = ["goat", "goat", "car"];
@JanDW
JanDW / boonie_Monte_Carlo.m
Created August 31, 2020 01:59
Runs a Monte Carlo experiment of the Boonie simulation
% Runs a Monte Carlo experiment of the Boonie simulation
%
%
% Input(s)
% nMC: Number of Monte Carlo iterations
%
% Output(s)
% Days: Vector of days until Boonie gets caught
%
% Example: