This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createSignal, onCleanup } from "solid-js"; | |
| // 1. Define the contract for what a row instance must return | |
| export interface RowHandle<T> { | |
| element: HTMLElement; | |
| update?: (item: T) => void; // Optional: for surgical in-place property updates | |
| } | |
| // 2. The Generic Retained Binder | |
| export class RetainedBinder<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createSignal, onCleanup } from "solid-js"; | |
| // ============================================================================ | |
| // 1. DECLARATIVE REACTIVE ROW COMPONENT | |
| // ============================================================================ | |
| export interface TodoRowProps { | |
| id: string; | |
| text: string; | |
| initialCompleted: boolean; | |
| onToggle: (id: string) => void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createSignal, onMount } from "solid-js"; | |
| import { createEmitter } from "@solid-primitives/event-bus"; | |
| // ========================================== | |
| // 1. TYPES & DELTA DEFINITIONS | |
| // ========================================== | |
| export type TodoDelta = | |
| | { type: 'addTodo'; id: string; text: string; completed: boolean; index: number } | |
| | { type: 'removeTodo'; id: string } | |
| | { type: 'swapTodos'; indexA: number; indexB: number } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Define Delta Action Types | |
| export type ListDelta = | |
| | { type: 'insert'; id: string; index: number; text: string } | |
| | { type: 'remove'; id: string } | |
| | { type: 'swap'; indexA: number; indexB: number } | |
| | { type: 'updateText'; id: string; text: string }; | |
| // 2. Batched Delta Event Bus / Queue | |
| export class DeltaBus { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class LowLevelCoordinateMap<V> { | |
| private capacity: number; | |
| private mask: number; | |
| private size: number = 0; | |
| private maxLoadFactor = 0.7; | |
| // Stores structural composite keys flat in memory: [x0, y0, z0, x1, y1, z1, ...] | |
| private keys: Int32Array; | |
| // Standard array storing the mapped values, aligning perfectly with the key slots | |
| private values: Array<V | undefined>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 1. Bootstrap Lazy.nvim | |
| local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
| if not vim.loop.fs_stat(lazypath) then | |
| vim.fn.system({ | |
| "git", "clone", "--filter=blob:none", | |
| "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath, | |
| }) | |
| end | |
| vim.opt.rtp:prepend(lazypath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Vertex } from "./Vertex"; | |
| const SANITY_CHECKS = false; | |
| export class IntrusiveIndexedPriorityQueue< | |
| A extends { | |
| pqRank: number, | |
| inPq: boolean, | |
| pqPrev: A | null, | |
| pqNext: A | null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <svg version="1.1" viewBox="-16 -16 32 32" style="width: 192px; height: 192px; user-select: none; outline: none; --rot: 20deg;"> | |
| <defs> | |
| <linearGradient id="shape-fill" x1="0" x2="0" y1="0" y2="1"> | |
| <stop offset="0%" stop-color="rgb(80, 80, 81)"/> | |
| <stop offset="100%" stop-color="rgb(30, 30, 31)"/> | |
| </linearGradient> | |
| <path id="shape" d=" | |
| M14.876 -5.890A-16 -16 0 0 0 14.876 5.890A16 16 0 0 112.539 9.938A-16 -16 0 0 0 2.337 15.828 | |
| A16 16 0 0 1-2.337 15.828A-16 -16 0 0 0 -12.539 9.938A16 16 0 0 1-14.876 5.890A-16 -16 0 0 0 -14.876 -5.890 | |
| A16 16 0 0 1-12.539 -9.938A-16 -16 0 0 0 -2.337 -15.828A16 16 0 0 12.337 -15.828A-16 -16 0 0 0 12.539 -9.938 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://playground.solidjs.com/anonymous/7ccf3971-2a47-45d5-82ed-1bc3a0481637 | |
| import { render } from "solid-js/web"; | |
| import { type Accessor, createSignal, createMemo, type Signal, onCleanup, untrack, For } from "solid-js"; | |
| function createSelector(a: Accessor<string | undefined>): (k: string) => boolean { | |
| let map = new Map<string,{ | |
| s: Signal<boolean>, | |
| refCount: number, | |
| }>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Performs 4-bit integer addition using direct, unrolled carry-lookahead logic. | |
| * This function serves as a building block for the 32-bit adder. | |
| * | |
| * @param {number} nibbleA The first 4-bit input (0-15). | |
| * @param {number} nibbleB The second 4-bit input (0-15). | |
| * @param {number} carryIn The carry-in from the previous 4-bit block (0 or 1). | |
| * @returns {{sum: number, carryOut: number}} An object containing the 4-bit sum and the carry-out. | |
| */ | |
| function add4BitCarryLookahead(nibbleA, nibbleB, carryIn) { |
NewerOlder