This updates claude with customized spinner words, available in claude code 2.1.23+ (tweet)
On line installer:
curl -sL "https://gist.githubusercontent.com/pi0/7bcc61a0bc3944908f9d1471ddb3796f/raw" | claude -p --allowedTools "Edit,Read,Write"This updates claude with customized spinner words, available in claude code 2.1.23+ (tweet)
On line installer:
curl -sL "https://gist.githubusercontent.com/pi0/7bcc61a0bc3944908f9d1471ddb3796f/raw" | claude -p --allowedTools "Edit,Read,Write"| # https://conduit.psiphon.ca/en/ | |
| # https://github.com/Psiphon-Inc/conduit/pull/136 | |
| # https://github.com/pi0/conduit | |
| services: | |
| conduit: | |
| container_name: conduit | |
| image: ghcr.io/pi0/conduit | |
| restart: unless-stopped | |
| command: ["start", "-b", "40", "-m", "200", "-v", "-s"] |
| import { createRequire, builtinModules } from 'node:module' | |
| // Node.js below v22.3.0, v20.16.0 | |
| if (!globalThis.process.getBuiltinModule) { | |
| const _require = createRequire(import.meta.url) | |
| globalThis.process.getBuiltinModule = (name) => { | |
| if (name.startsWith("node:") || builtinModules.includes(name)) { | |
| return _require(name) | |
| } | |
| } |
| // list-notifications.js | |
| const API = "https://api.github.com/notifications"; | |
| const TOKEN = process.env.GITHUB_TOKEN; | |
| if (!TOKEN) { | |
| console.error("Set GITHUB_TOKEN (classic PAT with `notifications` scope)."); | |
| process.exit(1); | |
| } | |
| const args = process.argv.slice(2); |
| clk: ~4.24 GHz | |
| cpu: Apple M4 Pro | |
| runtime: node 22.18.0 (arm64-darwin) | |
| benchmark avg (min โฆ max) p75 / p99 (min โฆ top 1%) | |
| ------------------------------------------------- ------------------------------- | |
| โข single check per iteration | |
| ------------------------------------------------- ------------------------------- | |
| instanceof Promise 1.55 ns/iter 1.59 ns 2.07 ns โโโโโโโโโโโ | |
| typeof x.then === "function" 3.72 ns/iter 3.92 ns 4.87 ns โโโโโโโโโโโ |
| export default { | |
| async fetch(req: Request): Promise<Response> { | |
| const stream = new ReadableStream({ | |
| async start(controller) { | |
| const encoder = new TextEncoder(); | |
| for (const token of getTokens()) { | |
| controller.enqueue(encoder.encode(token + " ")); | |
| await new Promise((resolve) => setTimeout(resolve, 25)); | |
| } | |
| controller.close(); |
| const nuxtBuildMonitor = async (_, nuxt) => { | |
| const timings = {} as Record<string, number>; | |
| const os = await import('node:os'); | |
| const fs = await import('node:fs'); | |
| fs.writeFileSync('timings.log', '', 'utf8'); | |
| const log = (message: string) => { | |
| const timeTag = `[${new Date().toLocaleTimeString()}]`; |
| import { bench, summary, run } from "mitata"; | |
| import { createStorage, defineDriver } from "unstorage"; | |
| import fsLite from "unstorage/drivers/fs-lite"; | |
| const denoDriver = defineDriver((opts) => { | |
| return { | |
| async getItem(key: string) { | |
| const val = await Deno.readTextFile(`${opts.base}/${key}`); | |
| return val; | |
| }, |
| function reportRollupTiming(build) { | |
| if (!build.getTimings) { | |
| console.log( | |
| "Rollup timing information is not available. Make sure `perf: true` config is set." | |
| ); | |
| return; | |
| } | |
| const formatTime = (ms) => | |
| ms > 1000 ? `${(ms / 1000).toLocaleString()}s` : `${ms.toLocaleString()}ms`; | |
| const timings = build.getTimings(); |
| # The Lazy Coder's Guide to Programming | |
| ## Chapter 1: The Art of Copy-Pasting | |
| ### Section 1.1: Ctrl+C, Ctrl+V, Repeat | |
| Programming can be hard. But fear not! With the power of copy-paste, you can conquer any coding challenge without breaking a sweat. Just remember: if it works once, it'll work a thousand times. Who needs original code anyway? | |
| ## Chapter 2: Debugging 101: Blame the Compiler |