Surma

@surma
1.7K Followers
177 Following
72 Posts
DX & monorepo at Shopify.
Craving simplicity, finding it nowhere.
Internetrovert 🏳️‍🌈 He/him.
Homepagehttps://surma.dev
GitHubhttps://github.com/surma
Twitterhttps://x.com/dassurma
You know your @js13kGames submission is going well when you have to resort to `btoa` and other seemingly stupid hacks to get below the file size limit.

Nix friends: How terrible is this idea?

I added `builtins.runWasm` to nix, allowing you to call out to Wasm. The Wasm is reset every time, so the functions remain pure. This gives you a (performant?) escape hatch for things that Nix is missing. E.g parsing YAML (here: via Rust)

Unexpected dangers of vibe coding:
Somehow git ended up tracking its own .git folder and now I can't commit anymore :3
I love what keybr.com thinks Rust code looks like

Still discovering new shell tricks.

TIL: Substitutions.

`cmd <(cat file)` invokes `cmd` with the first parameter being a named pipe (e.g. `/dev/fd/22`) which contains the contents of `file`.

Example use-case: You wanna diff two files, but they are binary so need disassembling

I find it remarkable that xkcd just casually invented the term "nerd sniping" in a comic, and it is now a completely normal word to use ...

https://xkcd.com/356/

Nerd Sniping

xkcd

Scheduled a pickup with DHL, they never arrived and I can’t schedule a new pickup time.

Went to website and clicked on “Help & Support”. It shows this in response.

10/10 would Lorem Ipsum again.

(⚠️ Definitely one of the dumber things I have written)

This ES6 Proxy lets you instantiate any WebAssembly module without having to care about every import it requires. It generates an empty function for the ones you don’t provide.

https://gist.github.com/surma/da12f7dfeaa398d5bbb32bcbb8813d4e

proxy.js

GitHub Gist: instantly share code, notes, and snippets.

Gist

I added experimental support for JavaScript sourcemaps (both inline and separate) to Wasmphobia.

I liked the idea of making it a one-stop-shop for all your bundle analysis needs 😅

https://wasmphobia.surma.technology/

Wasmphobia

I really wanted to know which libraries are bloating my WebAssembly binaries, so I wrote a visualizer.

Throw in a .wasm file with DWARF debug symbols, and wasmphobia will generate a flame graph for you, breaking down the module by source file.

https://wasmphobia.surma.technology/

Wasmphobia