Skip to content

Instantly share code, notes, and snippets.

@nichoth
nichoth / random.sh
Created May 17, 2026 08:06
random string
openssl rand -base64 32
@nichoth
nichoth / README.md
Last active May 17, 2026 11:36
Cloudflare + images

CF + Images

Use a blurry placeholder for images. It's a little bit harder when the images are unknown in advance, so we generate the blurhash string at runtime, and use several caches for the HTML and blurhash string.

Blur-Up

We use the @substrate-system/blur-hash web component to do the blur-up technique.

@nichoth
nichoth / artificial-productivity.md
Last active May 17, 2026 16:58
artificial productivity

Artificial Productivity

How to use these tihngs.

Like most people, I have had success with splitting things into a planning stage followed by an implementation stage. The implementation phase can be kind of synchronous/interactive, or can be a fully auto Ralph loop.

1. The Plan

# Conformance suites: what they are, when they help, how to build one
A conformance suite is a third axis of testing — distinct from unit tests
and integration tests. Where unit tests prove that a function does what
its body says, and integration tests prove that subsystems compose, a
conformance suite proves that **what the public API claims it does
matches what it actually does, against an external ground truth**.
This document explains the pattern, when it earns its keep, and how to
set one up. The case study is ferrotorch (a pure-Rust PyTorch
@nichoth
nichoth / ralph.md
Last active April 25, 2026 04:27
ralph loop

ralph loop

With "reasoning" escalation.

Bash Script

#!/bin/bash
set -o pipefail  # catch CLI failures
@nichoth
nichoth / fonts.md
Created April 21, 2026 22:05
fonts
@nichoth
nichoth / method.md
Created April 7, 2026 18:07 — forked from dollspace-gay/method.md
Verification-Driven Development (VDD) via Iterative Adversarial Refinement

Verification-Driven Development (VDD)

Methodology: Iterative Adversarial Refinement

Overview

Verification-Driven Development (VDD) is a high-integrity software engineering framework designed to eliminate "code slop" and logic gaps through a generative adversarial loop. Unlike traditional development cycles that rely on passive code reviews, VDD utilizes a specialized multi-model orchestration where a Builder AI and an Adversarial AI are placed in a high-friction feedback loop, mediated by a human developer and a granular tracking system.

I. The VDD Toolchain

@nichoth
nichoth / base64.ts
Last active November 14, 2025 20:48
Base64 tricks
function fromUrlEncoded (base64url:string):Record<string, any> {
const base64Url = token.split('.')[1];
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
return JSON.parse(atob(base64));
}
@nichoth
nichoth / crypto.ts
Created November 11, 2025 04:04
Perform Diffie-Hellman Key Exchange with the web crypto API (in a browser)
// Generate X25519 key pairs
async function generateX25519KeyPair(): Promise<CryptoKeyPair> {
return await crypto.subtle.generateKey(
{
name: "X25519"
},
true, // extractable
["deriveKey", "deriveBits"]
);
}
@nichoth
nichoth / constants.ts
Last active May 4, 2026 22:32
Some Constants, em dashes and things
export const EN_DASH = '\u2013'
export const EM_DASH = '\u2014'
export const NBSP = '\u00A0'
export const ELLIPSIS = '\u2026'
export const COPYRIGHT = '\u00A9'
export const BULLET = '\u2022'
export const AMP = '\u0026'
export const LT = '\u003C'
export const LTE = '\u2264'
export const GT = '\u003E'