Bao Huynh (@bhuynhdev) header
Bao Huynh (@bhuynhdev) profile picture

Backend Engineer 1 @OnlineRewards. Expert chess sacrificer ♛♟️& master at ruining my own sleep schedule. Connect with me at https://teapaw.org/t.co/2Se3RvzYrB

Cincinnati
Joined August 2019
Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)Photo by Bao Huynh (@bhuynhdev)
My new noob @sveltejs discovery: You might NOT need $derived! For simple expressions, put it straight into your markup. They're still reactive! $derived is useful for reactive **variable** w/ a complex expression and/or to be re-used many times. But otherwise, I prefer simple
2
146
I feel silly only realizing this about Svelte today. Bonus discovery: expression interpolation is the only way to do this, whereas $derived can't
1
53
More reason to love @DrizzleORM for me:🆕 "drizzle-seed" just dropped last week 🌱 - Just pass in your schema - Intelligent default generators - Ability to further refine generation - Seed relationships too - Utility to reset whole table drizzle-seed now on Drizzle 0.36.4!
1
67
drizzle-seed comes w/ some sane default generators based on your column type and names. Examples: - col type includes "date" → GenerateDate - string col with "name" in name → GenerateFirstName - "email" → GenerateEmail More at: github.com/drizzle-team/driz…
1
32
The "writable derived" is an incredible Svelte trick I just learned from @joyofcodedev 🚩 Problem: 2-way sync btw two states, but can't use "$derived" because it's 1-way readonly → ✅Use an object with get/set Here, typing activate checking, and unchecking also reset email
3
1
12
573
Unsure if this's recommended or not - I can't find anything about this in Svelte doc (maybe I don't know the right keyword) - but it feels so elegant! This probably equals setting up some "$effect", but coming from React, I was taught that I should minimize effect usage
1
78
TIL: A <button> element inside a <label> element will not work, as the button captures the click for itself and doesn't pass it to the label at all. Greedy buttons.
62
Today I converted another person to the no-barrel-files team. Feels great.
57
TIL: the server is an incremental static site regenerator
60
Wow the SvelteKit CLI feels so nice and polished and user-friendly
50
Svelte 5 with Runes feel like React but with more (and a lot more) batteries included
65
Spent an hour today fixing a bug caused by auto-import importing my SideBar component from "lucide-react" instead of "~/components/ui/sidebar.tsx" 🤦 Wish that all lucide-react icon always have Icon suffix
54
TIL: HTML checkbox input has a default value of "on" if you checked it In the reverse case of not checking, the form will simply not send the field to the server
41
PSA: Store your timestamps in the db in UTC timezone. This consistency will makes it much easier to think and reason about when you're parsing and localizing across different time zones Date and time is a real headache
1
68
Tmux stuff I learned today ⭐️You can just write "kill-sess" for "kill-session" ⭐️Enter copy mode w/ <prefix>+[ I never knew this. I was struggling to hold down the mouse selection while trying to press Ctrl Shift C with the other hand ⭐️You can enable vi keybind in copy mode
1
39
TIL: <button> actually has a type "reset" for use when your buttons reset all inputs in the form. It is rarely useful, and is a huge annoyance when users accidentally click one, but hey it's there if you need it
1
85
TIL: The `pnpm why` command shows you why a package was installed, in case one day you need to debug package dependencies issues. Saw some warnings today about deprecated sub-deps I didn't install, so I used `pnpm why` to trace the top-level package that is potentially outdated.
42
Finally got to use git cherry-pick the first time today
57
Today I learned, in Promise.all, when a promise rejects (and thus making .all reject), other promises can STILL be running. So if your promises have side effects, be careful! Wish that MDN document this clearer. It's obvious when you realized, but definitely caught me off-guard
1
72
Just learned about the Diataxis framework for technical documentation, which propose 4 doc types: - Tutorial: practical steps & study-focused - Guide: practical steps & task-orientated - Explanation: theoretical knowledge & study-focused - Reference: theoretical & task-orientated
1
44
1st impression: the hierarchy is immensely practical. As a reader, I'll know exactly where to look for what! Forgetting where I found an awesome info piece, and had to "hunt" numerous pages to find it was painful. A clear system totally help categorize and stamp it onto my brain
1
33
Cool SQL feature you might not have known: Generated columns ⚒️ TIL: I can use generated column in My/PostgreSQL to auto calculate/insert a column based on other columns! I used it to generate a "first_last_email" that combines all strings so we can search anyone using any info
25
Random app that I cannot live without: Semantic emoji search emojisearch.app/
24
Been aspiring to integrate @vite_js into my company legacy codebase. It is frustrating and I can't use all Vite features, but I really love Vite's extensibility. There's always a setting for my need. Today I used `assetFilename` to put various types of files to different folders
1
1
79
Ok rollup is unfortunately not fast enough. Rolldown couldn't come soon enough. In the meanwhile, I will try to write a custom esbuild config
24