Skip to content

Instantly share code, notes, and snippets.

@nichoth
nichoth / signals.html
Created August 13, 2025 21:57 — forked from KonnorRogers/signals.html
Lite Signals
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Signals</title>
</head>
<body>
<button id="decrement">
-
@nichoth
nichoth / puuppeteer3.js
Last active June 11, 2025 21:52
more puppeteer
// @ts-check
import puppeteer from 'puppeteer'
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const ANIMATION_FRAMES = 30 // 1/2 second
const outputDir = path.join(__dirname, '..', 'screenshots')
@nichoth
nichoth / puppeteer2.js
Created June 11, 2025 19:11
Puppeteer again
// @ts-check
import puppeteer from 'puppeteer'
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const URL = 'https://nolaai.webflow.io/'
@nichoth
nichoth / index.js
Last active June 11, 2025 18:52
puppeteer
import puppeteer from 'puppeteer'
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const URL = 'https://nolaai.webflow.io/'
const browser = await puppeteer.launch({
accordion-group {
background-color: #f7f7f7;
border-radius: 0.25em;
display: block;
margin-block-end: 1.5em;
padding: 0.5em 1em;
width: 100%;
}
accordion-group [accordion-trigger] {
@nichoth
nichoth / LICENSE.md
Last active May 20, 2025 18:45
Big Time License

Big Time Public License

Version 2.0.2

Purpose

These terms let you use and share this software for noncommercial purposes and in small business for free, while also guaranteeing that paid licenses for big businesses will be available on fair, reasonable, and nondiscriminatory terms.

Acceptance

@nichoth
nichoth / index.ts
Last active February 19, 2025 04:03
Blake3 streaming + hashing
import * as blake3 from 'blake3';
async function streamHash(stream:ReadableStream<Uint8Array>):Promise<string> {
const hasher = blake3.createHash();
const reader = stream.getReader();
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
@nichoth
nichoth / demo.ts
Created December 27, 2024 04:19 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@nichoth
nichoth / webtorrent_demo.js
Created December 11, 2024 19:01 — forked from swapnilshrikhande/webtorrent_demo.js
WebTorrent Configure Custom STUN / TURN Server
var client = window.client = new WebTorrent({
tracker: {
rtcConfig: rtcConfig
}
})
client.on('warning', onWarning)
client.on('error', onError)
torrent = client.add(TORRENT, onTorrent)