Skip to content

Instantly share code, notes, and snippets.

@jkoppel
jkoppel / README.md
Created February 10, 2026 03:55
Permission demo files

README

@jkoppel
jkoppel / gist:d26732574dfcdcc6bfc4958596054d2e
Created February 8, 2026 22:37
Test showing Bun using 20x the CPU of Node
#!/usr/bin/env bun
/**
* Minimal reproduction: Bun TLS CPU overhead with concurrent HTTPS requests.
*
* This test sends N concurrent HTTPS POST requests with varying payload sizes
* to a public HTTPS endpoint and measures CPU consumption.
*
* Run with: bun run src/test-bun-tls-cpu.ts
* Compare with: node --experimental-strip-types src/test-bun-tls-cpu.ts
@jkoppel
jkoppel / Dockerfile
Created February 5, 2026 18:06
@parcel/watcher DirTree cache bug PoC - ignores patterns not included in cache key (Linux only)
FROM node:20-slim
WORKDIR /app
# Install build tools for native addon
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY package.json ./
RUN npm install
"All "best practices" and thought leader advice is geared
towards the baseline generic system in that field.
The baseline generic distributed system, the baseline
enterprise app, the baseline agile team, the baseline test suite.
No project is "baseline generic". All of them have complications,
whether technical, historical, or domain-related, that make them special.
"All "best practices" and thought leader advice is geared towards the baseline generic system in that field.
The baseline generic distributed system, the baseline enterprise app, the baseline agile team, the baseline test suite.
No project is "baseline generic". All of them have complications, whether technical, historical, or domain-related, that make them special.
Ideal "best practices" and "conventional wisdom" are those that still give pretty good outcomes, even for the special cases. They may not be *perfect* for your use case, but following them is still on the whole better than doing nothing at all.
The best outcomes, though, come from figuring out which "generic ideas" need to be adapted, or rethought, or ignored entirely in your situation. This is a lot harder to do, and also a lot harder to *teach*. Which is why it's not as much talked about.
# Lookup shell on explainshell
function explain() {
# Example url: http://explainshell.com/explain/tar?args=xzvf+archive.tar.gz
URL="http://explainshell.com/explain"
FIRST=0
for i; do
if [ $FIRST -eq 0 ]; then
URL="${URL}/$i?args="
FIRST=1
elif [ $FIRST -eq 1 ]; then
@jkoppel
jkoppel / gist:28fb6d4148866153711ac2ce1feab084
Created January 19, 2024 22:01
Error building trustfall
(venv) (base) [jkoppel@MacBook-Pro-173:tmp/trustfall]$ cargo build (01-19 04:53)
warning: output filename collision.
The lib target `trustfall` in package `trustfall v0.7.1 (/Users/jkoppel/tmp/trustfall/trustfall)` has the same output filename as the lib target `trustfall` in package `pytrustfall v0.1.6 (/Users/jkoppel/tmp/trustfall/pytrustfall)`.
Colliding filename is: /Users/jkoppel/tmp/trustfall/target/debug/libtrustfall.rlib
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
Compiling demo-hytradboi v0.1.0 (/Users/jkoppel/tmp/trustfall/demo-hytradboi)
Compiling pytrustfall v0.1.6 (/Users/jkoppel/tmp/trustfall/pytrustfall)
@jkoppel
jkoppel / gist:b1f97cd297ec500f11a0236cc6eecf3f
Created November 22, 2023 01:12
Experiments with section headings
############################# /*##########################\ -- ############################# --
############################# ############################# -- ############################# --
#### #### #### #### -- #### #### --
#### Section Heading #### #### Section Heading #### -- #### Section Heading #### --
#### #### #### #### -- #### #### --
############################# ############################# -- ############################# --
############################# \##########################*/ -- ############################# --
####################### /*###################*\ -- ####################### --
# # # # -- # # --
@jkoppel
jkoppel / Cooler.sol
Last active November 21, 2023 02:26
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {Clone} from "clones/Clone.sol";
import {IDelegate} from "interfaces/IDelegate.sol";
import {CoolerFactory} from "src/CoolerFactory.sol";
import {CoolerCallback} from "src/CoolerCallback.sol";
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
// External Libraries
import "solady/src/auth/Ownable.sol";
import "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
import "openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol";
import "openzeppelin-contracts/contracts/access/AccessControl.sol";
import "openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol";
// Interfaces