
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
- Tweets1.4K
- Following322
- Followers134
- Likes2K
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
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
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
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
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
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

ALT SQL code to generate a search_str Generated column that concat fields first_name, last_name, and email CREATE TABLE users ( user_id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR(100), last_name VARCHAR(100), email VARCHAR(255), search_str VARCHAR(455) GENERATED ALWAYS AS (CONCAT(first_name, ' ', last_name, ' ', email, ' ')) STORED );
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




