March 14, 2025 @ 08:55 PM UTC
You should never use magic numbers for your z-indexes. Centralize them using CSS variables in a global file. Your future self will thank you.
February 13, 2025 @ 11:09 PM UTC
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).
February 12, 2025 @ 10:36 PM UTC
Convert a ReadableStream to whatever format you want (JSON, Uint8Array, text, etc.) using the Response constructor: await new Response(myReadableStream).json()
February 04, 2025 @ 11:34 PM UTC
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.
January 28, 2025 @ 03:29 AM UTC
// 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; }
January 26, 2025 @ 09:58 AM UTC
Neat video on animating height to auto with just CSS, useful for accordions: https://www.youtube.com/watch?v=B_n4YONte5A
December 20, 2024 @ 03:27 AM UTC
Being able to implement traits on external types in Rust is super nice—wish you could do the same for interfaces in Go.
December 19, 2024 @ 02:48 PM UTC
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/
December 18, 2024 @ 01:01 PM UTC
The UX of native browser tooltips (using the `title` attribute) is so much better than fancy custom components that people build
December 17, 2024 @ 09:10 AM UTC
Next.js providers shared between components retain their value between navs