Skip to content

Instantly share code, notes, and snippets.

@sirisian
sirisian / Vector234.js
Created April 24, 2025 23:41
roguelike map gen
"use strict";
class Vector2
{
constructor(x = 0, y = 0)
{
this.x = x;
this.y = y;
}
Add(v)
@sirisian
sirisian / 1-negate.js
Last active February 13, 2026 20:41
negate and subset check for JSON Schema 2020-12
/**
* JSON Schema 2020-12 Negation Implementation
* Computes ¬(schema) for any JSON schema
*/
const TYPE_SPECIFIC_KEYWORDS = {
string: new Set(['minLength', 'maxLength', 'pattern', 'format', 'contentEncoding', 'contentMediaType']),
number: new Set(['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']),
integer: new Set(['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']),
boolean: new Set([]),
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Value Noise</title>
<script type="text/javascript">
// Canvas
var canvas = null;
var context2D = null;
var tiledcanvas = null;
@sirisian
sirisian / painterlyshader.html
Last active June 8, 2026 19:01
Painterly shader (Claude 4.8 Max assisted)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Painterly Cube — WebGPU (Phases 0–2)</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet" />
@sirisian
sirisian / occupancytree256.html
Created June 29, 2026 23:22
Occupancy Tree Example (Claude Opus 4.8)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WebGPU · per-pixel nested 4³ 3D-DDA volume</title>
<style>
:root{
--bg:#0a0c10;--panel:#12151c;--panel2:#161a23;--line:#1e2430;--line2:#2a3242;
--ink:#e9eef6;--mut:#8b95a7;--faint:#5b6473;--acc:#38bdf8;--acc2:#f0a830;--ray:#ff3d71;