Suraj
surajssingh.com
Suraj
@surajssingh.com
SILT#00168: There are two points that may make `Promise.try` interesting to try out over `try...catch` in JS code: 1. both sync and async functions can be passed in, and it will be treated asynchronously; and 2. catching errors can be handled with one location rather than two (in the `.catch`)
November 19, 2025 at 7:37 AM
SILT#00167: There's a weird edge case when using HTML popovers on a transparent window (like in Tauri), where a cutout appears of the popover if the transparent window is resized. To work around it, after a resize, hide the popover and resized again slight so it triggers the window to refresh state
November 18, 2025 at 7:19 AM
SILT#00166: The continuum hypothesis supposes that ℵ_1 = 2 ^ ℵ_0, where the power-set of Aleph null yields Aleph one. If we use this construction inductively (start with Aleph null and take power-sets for the next number), this gives a new set of infinite cardinality numbers called the Beth numbers
November 17, 2025 at 6:36 AM
SILT#00165: Consider how we might add a tagging system, a many-to-one connection. This article provides three ways to do within a database. Starts with one table holding all tags together, then two tables associating tags with key, and finally three tables, where data is associated with tagmap table
Tags: Database schemas
Recently, on the del.icio.us mailinglist, I asked the question “Does anyone know the database schema of del.icio.us?”. I got a few private responses so I wanted to share the knowledge with the world. ...
howto.philippkeller.com
November 16, 2025 at 6:54 AM
SILT#00163: I've listened to so many music and media analysis that any time I'm listening to music, even unfamiliar ones, I can imagine a whole scene where it would slot into. Now the fun part is when listening to mashups, which produces some wild combinations
November 15, 2025 at 7:48 AM
SILT#00163: I always have to do a double take when scaling sprites in Unity using Pixels per Unit. One way to remember it is to think of it like an inverted zoom, larger number means smaller sprite (more pixels needed to take up one unit), while smaller number is larger sprite (fewer pixels needed)
November 14, 2025 at 7:31 AM
SILT#00162: No matter how many times I see it, I am always surprised how big the nasal cavity is and how close it makes the brain to the nose. I keep thinking there is a nerve that closes the gap, but nope, there's just the olfactory bulb (which is directly part of the brain) hanging out in the nose
November 13, 2025 at 7:12 AM
SILT#00161: One thing to watch out for when making a puzzle game is the Einstellung effect. Solving puzzles with complex answers makes it easier to keep reaching for complex answers when a simpler one may be possible. Unless you subvert this as part of the puzzle, make sure to have new people try it
November 12, 2025 at 7:41 AM
SILT#00160: ANF (A-normal form) is an intermediate representation (like CSP or SSA), where in this programming style, at a high-level, enforces that every arg to a func be a simple values (halt on eval) and any non-trivial result of the call be bound to a var. Useful for manually defining each step
November 11, 2025 at 7:26 AM
SILT#00159: How many nesting of options of booleans can fit within a byte in Rust. It's 254, due to how Rust can niche optimize: it knows that booleans can only be 0 or 1, so it can fill in the rest of the bit patterns with all the None variants. Now, if you nest this, be sure to have flatten handy
How many options fit into a boolean?
Funny notes on niche optimizations in Rust, and a few updates.
herecomesthemoon.net
November 10, 2025 at 7:04 AM
SILT#00158: I know Halloween has passed, but I stumbled across ghost and zombie marks as kinds of trademarks. Ghost marks are trademarks that shadow ordinary marks but aren't going to be used, while zombie marks are trademarks that were resurrected after being abandoned, often for name-recognition
November 9, 2025 at 6:56 AM
SILT#00157: Today, I realized there's an another way to add async commands in Tauri by adding `(async)` after the command attribute. This lead me down Rust's proc macro system, where I found that attribute macros pass two token trees, one for attribute args, and the other for the item being modified
November 8, 2025 at 6:24 AM
SILT#00156: In GitHub Actions, we can use `workflow_dispatch` to manually trigger a workflow. Also, we can add `inputs` beneath it to allow easy customization of items passed to a workflow (like adding separate channels or selecting features). This can be helpful in augment the automatic workflows
Workflow syntax for GitHub Actions - GitHub Docs
A workflow is a configurable automated process made up of one or more jobs. You must create a YAML file to define your workflow configuration.
docs.github.com
November 7, 2025 at 5:34 AM
SILT#00155: One thing to be mindful of is knowing which coordinate system values are operating in, especially if they have the same data types. Similar to the Mars Climate Orbiter error, having the wrong coordinates lead to wrong results. May be better to make a new type to prevent any confusion
November 6, 2025 at 7:43 AM
SILT#00154: I remember coming across this website once before, but now that I am working on a project using hexagonal grids, I rediscovered it, and I'll leave it here for others. It's a really good deep-dive on how hex grids works and how you can code them up: www.redblobgames.com/grids/hexago...
Red Blob Games: Hexagonal Grids
Amit's guide to math, algorithms, and code for hexagonal grids
www.redblobgames.com
November 5, 2025 at 7:02 AM
SILT#00153: Reading through grocery receipt had me go down a rabbit hole of looking at how food is taxed. Generally, for most states barring some exceptions, regular grocery items are exempt from sales tax, while any hot, prepared, or ready to eat foods are fully taxable
November 4, 2025 at 6:33 AM
SILT#00152: Botulinum toxin is produced by the spores of C. botulinum. The spores themselves are heat-resistant, but the toxin itself denatures at a sustained 5 minutes of around 85°C (185°F), so foods may be recoverable by heating up to it (though it may be better not to risk it if it can be done)
November 3, 2025 at 5:39 AM
SILT#00151: I dislike that "deadline mode" is unreasonably effective at getting me to put in the work. Even fake deadlines can't compete with the real thing. The only thing that really helps prevent overburdening it is making the smallest possible deadline that's manageable to get started with
November 2, 2025 at 6:38 AM
SILT#00150: Lectio brevior potior and lectio difficilior potior are two Latin phrases that represent two possible ways of resolving discrepancies between texts, one where "shortest reading is stronger" and the other where "most difficult reading is stronger" respectively
November 1, 2025 at 5:47 AM
SILT#00149: Consider the words uxorilocal and virilocality. They're fancy words for matrilocal and patrilocal, which might still feel fancy, but they mean which parents a married couple either lives near (wife's or husband's respectively). Neolocal is for living with neither, being away from both
October 30, 2025 at 6:41 AM
SILT#00148: There are more games to game theory than just prisoner's dilemma; one such is the stag hunt. It's very similar to the prisoner's dilemma, but with a payoff matrix that has two Nash equilibria (both co-op or both defect). This focuses on trust. Here's a cool post that illustrates this:
THE STAG HUNT
cultivating cooperation to reap rewards
nonzerosum.games
October 29, 2025 at 4:43 AM
SILT#00147: Custom labelers are an amazing way to help provides some additional context to your Bluesky browsing by providing small labels to a post with some information. Consider subscribing to this one for helping annotate when AI images are used bsky.app/profile/aimo...
bsky.app
October 28, 2025 at 5:40 AM
SILT#00146: Windows, by default, has a max path limit of 260 characters, which can be a pain if you have a dependency which has a dependency that needs to make a file, but fails to without a clear reason why. Two ways to fix it: update a Windows registry value, or move the project up to shorter path
October 27, 2025 at 6:29 AM
SILT#00145: Here is a website that visualize chord dissonance in a 3D plot. Might take some inspiration from this for embedding my own dynamic plot. Also had some fun creating some interesting sound like a weird train crossing bell. Link to the site: aatishb.com/dissonance/
To hear the sound, press the button below.
aatishb.com
October 25, 2025 at 6:56 AM
SILT#00144: Know how to fork a dependency should it be needed, for it opens up the ability to make changes that work. Know how to integrate it, so it may serve as a new foundation for the work. Know how to contribute back, for that will help the original flourish and bring the work to others
October 23, 2025 at 6:08 AM