Hah, this is interesting. Steve Klabnik likes to write tutorials for things as he learns about them, and apparently that’s how The Rust Programming Language came about: https://steveklabnik.github.io/jujutsu-tutorial/. He seems to have a nice setup for writing these tutorials that’s based on mdBook (https://rust-lang.github.io/mdBook/index.html).
Convert a ReadableStream to whatever format you want (JSON, Uint8Array, text, etc.) using the Response constructor: await new Response(myReadableStream).json()
It would be super sick to have a Mac app that allows you to map domain names to ports on the local machine. It would make local development when you have multiple backend servers so much easier. It would be pretty easy to build too—just a UI around /etc/hosts.
// Convert a Uint8Array containing pcm_s16le data to a Float32Array containing
// pcm_f32le data.
function toFloat32Array(uint8Array: Uint8Array) {
const dataView = new DataView(uint8Array.buffer);
const float32Array = new Float32Array(uint8Array.length / 2);
for (let i = 0; i < float32Array.length; i++) {
const int16 = dataView.getInt16(i * 2, true); // Read little-endian int16
float32Array[i] = Math.max(-1, int16 / 32768.0); // Normalize to [-1.0, 1.0)
}
return float32Array;
} Neat video on animating height to auto with just CSS, useful for accordions: https://www.youtube.com/watch?v=B_n4YONte5A
Being able to implement traits on external types in Rust is super nice—wish you could do the same for interfaces in Go.
Another great resource on organizing Go server code: https://grafana.com/blog/2024/02/09/how-i-write-http-services-in-go-after-13-years/
The UX of native browser tooltips (using the title attribute) is so much better than fancy custom components that people build
An intuitive proof of the CAP theorem: https://mwhittaker.github.io/blog/an_illustrated_proof_of_the_cap_theorem/