Bao Huynh
bhuynh.dev
Bao Huynh
@bhuynh.dev
Backend Engineer
Web-deving with React, Solid, and a bunch of other stuff
https://bhuynh.dev
My top fav dish
March 11, 2025 at 9:30 PM
TIL: `onpointerup` to make mobile-only click event.

On mobile w/ limited horizontal space, I want to implement tapping on the row to show extra info. But on desktop with lots of whitespace, I prefer dedicated buttons.

→ Solution: Mobile-only clicking with `onpointerup` and `event.pointerType`
February 21, 2025 at 3:26 PM
TIL: ESM Dynamic import has a cache!

So if you're developing a module to be dynamically imported, and seeing that it keeps importing the old version, you can bust the cache by just adding a query string with `Date.now()`
February 13, 2025 at 8:37 PM
My Git wrap for this year

Honestly better than I thought but definitely has room for improvements.

Nice to be able to put actions into metrics, so I can come to 2025 stronger

I don't know where the 25 stars come from haha

git-wrapped.com/profiles/bhu...
December 21, 2024 at 8:28 PM
Svelte 5 runes tip: exporting reactive values across files = WRAP it in a function

Get/set accessor, class method, or just plain function

This's because runes/signals are just plain-old JS that work by calling functions to access latest values

This truly blows my mind coming from React and hooks
December 20, 2024 at 10:31 PM
More random mini Git tips to make your day easier:

To test a merge without actually merging first - to see if you will have any merge conflicts

⭐ `git merge <branch> --no-commit ---no-ff` ⭐

If you then don't like the conflicts, you can `git merge --abort` it
December 17, 2024 at 8:56 PM
A mini Git tip to make your life easier

If you're using `git commit -m` then suddenly realize this commit message is gonna be a lot longer than expected

→ Use the `--edit` flag to open up a Message Edit window to further add to your commit
December 10, 2024 at 6:08 PM
Spent hours today debug why Mandarin wouldn't display on WezTerm but VsCode works.

Turns out MacOS default *implicitly* fallback on "PingFang SC". Not obvious at all.

I fixed it w/ Noto Sans CJK SC 🧑‍🍳💋

And the story's hero is WezTerm's incredible CLI, with the exact command for debugging fonts 🙏
December 7, 2024 at 2:37 AM
New vim/neovim knowledge

You can tell vim to "unmask" invisible characters such as tab or space with the simple `:set list` command

Tabs are now >
space are -
and non-breaking space are +

Undo with `:set nolist`
December 6, 2024 at 6:42 PM
I feel silly only realizing this about Svelte today.

Bonus discovery: expression interpolation is the only way to do this, whereas $derived can't
December 3, 2024 at 12:46 AM
My new noob discovery about @svelte.dev $derived: You might NOT need it!

For simple expressions, put it straight into your markup. They're still reactive!

$derived is nice to get a reactive **variable** for a complex expression and/or to be re-used many times.

Other case, I prefer interpolation.
December 3, 2024 at 12:41 AM
Or further refine for more sophisticated schemas w/ drizzle-seed's included generators, or even your own implementation

drizzle-seed has:
- valuesFromArray
- int
- firstName/lastName/fullName
- phoneNumber
- country
- jobTitle
- companyName

and more at orm.drizzle.team/docs/seed-fu...
November 28, 2024 at 10:53 PM
More reason to love @drizzle.team 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!
November 28, 2024 at 10:50 PM