Skip to content

Instantly share code, notes, and snippets.

@arvinall
arvinall / README.md
Created October 15, 2025 16:25
Bun script to serve a simple front library playground

Library Playground

Save file in one of your paths directories then rename lpg.js to-> lpg (remove .js ext)

Then make it executable via: chmod +x lpg

Examples

~/projects/lib1> lpg # serve namespace reference to .../lib1/lib/index.js at localhost:3000 as globalThis.lib1
@arvinall
arvinall / create-timer.js
Last active May 10, 2023 13:39
Create multiple timers with just one setTimeout call
function createPromise () {
let resolve, reject
// eslint-disable-next-line promise/param-names
const promise = new Promise((...args) => ([resolve, reject] = args))
return { promise, resolve, reject }
}
const remove = (a, y) => (