video scr can not be loaded it turns out to be the git ignore file, coz during testing period, I do not to upload my testing video to git hub due to the size of it, so I put “.mp4” key...
cron task
我设置了一个定时任务来跟踪 cw 网站上的价格变化,代码是这样的:schedule.scheduleJob(“* * */5 * * *”, () => {…});。我预期这个任务每 5 小时运行一次。然而,很快我发现 record 函数频繁运行,大概每一秒一次。后来查阅资料后,才知道 ~~~ The cron expression * * */5 * * * brea...
Strong typed Polymorphic component
Creating an polymorphic component In this example, we’ll leverage typescript to build a strong typed component that can have its only props instead of setting all props as optional props s...
Dropdown manual with recursive method
Creating a Recursive List Menu Any Number of Levels Deep In this example, we’ll leverage recursion to build a menu that can have an unlimited number of nested levels. And the result will ...
debounce
debounce what is debounce A debounce function in JavaScript ensures that your code is executed only once per user input. It is commonly used for scenarios such as search box suggestions, t...
3D CSS
3D transform-style: flat vs transform-style: preserve-3d refer to link The transform-style CSS property sets whether children of an element are positioned in the 3D space or are flatt...
Next.js font optimization
Next Font optimization next/font includes built-in automatic self-hosting for any font file. This means you can optimally load web fonts with zero layout shift, thanks to the underlying CSS siz...
Stripe Webhook
Why Webhook? To ensure security, Stripe hosts the payment session, which means our server remains unaware of the payment session’s status as it takes place exclusively on the Stripe website. To...
custom Express request object in typescript
To add a custom request head for deserialize user in authentication Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'. To fix...
create a sorting table in React
Create a react sorting function pass the list for sorting, and we will need to know which column we want to start sorting, so we will need two argument, which is the list and the column, last b...