Skip to content

Instantly share code, notes, and snippets.

@t3dotgg
t3dotgg / try-catch.ts
Last active July 3, 2025 10:47
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@thewheat
thewheat / brunei_calendar.csv
Last active June 9, 2025 12:08
Brunei Calendar Dates for Public Holidays, School Terms, School Term Holidays based
Name Type Start Date End Date Moon Dependent Notes
New Year's Day Public Holiday 2025-01-01 2025-01-01 N Wednesday
Isra' Mi'raj Public Holiday 2025-01-27 2025-01-27 N Monday
Chinese New Year Public Holiday 2025-01-29 2025-01-29 N Wednesday
National Day Public Holiday 2025-02-23 2025-02-23 N Sunday
National Day Public Holiday Replacement 2025-02-24 2025-02-24 N Monday
First Day of Ramadhan Public Holiday 2025-03-03 2025-03-03 Y Sunday 2025-03-02 / Monday 2025-03-03
Nuzul Al-Qur'an Public Holiday 2025-03-18 2025-03-18 Y Tuesday 2025-03-18 / Wednesday 2025-03-19
Hari Raya Public Holiday 2025-03-31 2025-04-02 Y 3 days starting on Monday 2025-03-31 / Tuesday 2025-04-01
RBAF Day Public Holiday 2025-05-31 2025-05-31 N Saturday
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 3, 2025 20:26
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).