Skip to content

Instantly share code, notes, and snippets.

View MatthewWid's full-sized avatar

Matt W MatthewWid

View GitHub Profile
@MatthewWid
MatthewWid / perfsess.ts
Last active May 14, 2025 06:35
PerfWtf: A caveman's solution for quick and dirty performance testing. Used for profiling individual function runtimes of the Better SSE Session class.
import EventSource from "eventsource";
import {createHttpServer, getUrl, waitForConnect} from "./lib/testUtils";
import {Session} from "./Session";
import {perfWTF} from "./perfwtf";
(async () => {
const server = await createHttpServer();
const url = getUrl(server);
@MatthewWid
MatthewWid / set_hostname.sh
Created September 10, 2020 21:11
Grab the host machine IP from inside WSL 2.
export HOSTNAME="$(cat /etc/resolv.conf | grep "nameserver" | cut -f 2 -d ' ')"