How to use the new Temporal API

Working with JavaScript Date has always been a struggle. Libraries like moment (18kB gzipped), day.js (3kB gzipped) and luxon (23kB gzipped) filled the gap by giving a more developer friendly API, but they take up more network bandwidth, add dependencies and increase build times. That’s where Temporal comes in. Browsers have been working hard to implement Temporal with the TC39 Stage 3 draft specification so we hope to see it fairly soon....

January 25, 2024 · 2 min · Hubert Lin
Hono logo and supabase logo

Hono with Supabase Edge Functions

Hono is a strongly typed middleware webserver that runs on all modern JS runtimes. Supabase is a backend as a service. They offer a database, autogenerate REST API, Auth, edge functions and more. Why Supabase? I was looking for a way to speed up the development of my prototype ideas while still being able to learn new technologies like PostgreSQL, Deno, TypeScript. I also considered Firebase, and AWS Amplify but the open source nature of Supabase and the fact it used Postgres as a datastore made me interested....

January 15, 2024 · 5 min · Hubert Lin

Do not store dates as local time

Alberta’s winter is known to have short hours of sunlight while summers are known to have long bright sunny days. So, I guess someone wanted to save what little sunlight we had in winter and proposed Daylight Savings Time (DST). Daylight Savings Time starts every year in March and ends in November. For the months in DST, we use GMT-6 Mountain Daylight Time, and outside DST we use GMT-7 Mountain Standard Time....

November 30, 2022 · 3 min · Hubert Lin

Cheap Web Hosting Options

In the last 2 years, I shopped around and found cheap web hosting options for my projects, here’s what I found. What makes a hosting provider good? For me, it needs to have a good developer experience, decent documentation, security features like 2FA, and maybe Github integration. I’m excluding cloud providers from this post because in my past experience I found their free tiers and configuration complexity not worth the hassle for smaller projects, but still definitely worth considering....

April 4, 2022 · 5 min · Hubert Lin

Strategy Pattern and Null Object Pattern

Most of the code I’ve been writing is automating business processes. As a programmer I tell the computer what to do under specific conditions, and often those conditions change. Trying to make correct decisions can be paralyzing because it’s hard to know what new requirements will come. Thank goodness for software design patterns. Software design patterns can help write code that is resilient to future change. Here’s my take on the Strategy Pattern and the Null Object Pattern....

January 24, 2022 · 7 min · Hubert Lin