huy.rocks/everyday

everyday: Development Log

Recently Added

TypeScript/Test parameter passed into a function with Jest
TypeScript/Optional Chaining and Code Coverage
Typescript/Mocking File and FileList in Jest
TypeScript/Testing localStorage in Jest
Self-hosting/Migrating docker-compose application to M1 Mac
Parsing/Recursive Descent Parser
Compilers/Virtual Stack Machine/Variable declaration

Posts by categories

TYPESCRIPT

Test parameter passed into a function with Jest
Optional Chaining and Code Coverage
Mocking File and FileList in Jest
Testing localStorage in Jest
Building an Event System using the browser’s CustomEvent
Understanding “keyof typeof”
Use String As Enum Key
Some random notes about Classes
How the compiler compiles
The intrinsic keyword
How some utility types are implemented
A note about lib.dom.d.ts
Source Code Walkthrough: InlayHints
Arrow Function in Classes
Type Annotation vs Type Assertion
Lookup Types
Enums at runtime and tree-shaking
The unknown type
Implement Rust-style Result
Testing with Jest
Build a library with Parcel
Type Intersection
Non-null assertion operator

SELF-HOSTING

Migrating docker-compose application to M1 Mac

PARSING

Recursive Descent Parser
Railroad Diagrams
Backus-Naur Form and variants
Context-Free Grammar/Leftmost and Rightmost Derivations
Context-Free Grammar

COMPILERS

Virtual Stack Machine/Variable declaration
How Virtual Stack Machines Executed

ALGORITHMS

Extract digits of a number from both ends
Detect chess piece movement with Bitboard
Tracking letter frequency with Hashmap and Array
Cyclic Sort: Sorting in O(N)
Fast and Slow Pointers For Linked List
Sliding Window With Two Pointers
Merge two sorted arrays with extra space
Comparing floating-point numbers
Find Palindrome
Partition a number to sum of smaller ones
Generate repeated combinatorial

DATA STRUCTURES

Introduction to Bitboard
Representing Graphs
Binary Search Tree/Delete node
Binary Tree/In-order Traversal with Stack

MATH

Circle and Ray Intersection
Prime Factorization Uniqueness
Interpolation Methods
Count number of digits with Logarithm

READING NOTES

Detect Infinite Recursive Call with Control Flow Graph
Wall Clock and Monotonic Clock
Understand Complex Code with Dry Run
Collector’s Fallacy and the cure
Contributing to complex projects
How to Edit Your Own Writing
Two modes of thinking: Focused mode vs. Diffuse mode
The Curse of Knowledge
Browser Rendering: Painting and Compositing
Forced Synchronous Layout and Layout Thrashing
Two types of Knowledge
Browser’s Rendering Process
Zeigarnik Effect
Tetris Effect
Suffering Oriented Programming
Rediscovering the Benefits of Drawing
The Art of Close Reading

GOLANG

Use Delve on M1 Mac

MONOREPO

Code organization when using Nx

REACT

Memoization with React.memo
How React’s Diffing Algorithm Works
Render a component to any DOM node with React Portals

TYPOGRAPHY

Respect user’s default font size
Hanging Punctuation
Faux Bold and Faux Italic

CSS

List counter-reset and the start attribute
Percentage Padding and Margin

SKILLS

Active Listening

ANGULAR

Component CSS Isolation
A 5 minutes guide to getting started

RUST

Skip some fields when serializing
Notes about Vector and memory allocation
Blanket Implementation
The Never Type
Lifetime Elision Rules
Dealing with Integer Overflow
Deref and DerefMut
Implement external traits for external types
GUI/Druid/Custom Widget

JAVASCRIPT

Partial update an object in IndexedDB
Moving from LocalStorage to IndexedDB
Beware the delete
Named Imports and Dead Code Elimination
Use any ASCII characters as a variable name
Console Assert Command

ELM

Building large Elm applications

RXJS

Cancel Request with Subscription

SEO

Structured Data for Google Search

GIT

CODEOWNERS file

DESIGN PATTERNS

The Elm Architecture

SECURITY

How Bitwarden encrypts your data
Cryptography/PBKDF2
Timing Attack and Constant-time Compare Algorithm

VIM

Record and Replay Macro

CLOUDFLARE

Expose local server with Tunnel

HTML

Auto-fill OTP code from SMS

DENO

Non-blocking FFI Calls
Introduction to FFI API

SUPABASE

Row Level Security with application user

WEBASSEMBLY

Working with wasm-bindgen
Stack-based execution model
Tables and Dynamic Linking
Working with Linear Memory
How to read WASM code
A quick guide

ZIG

How ArenaAllocator works
Build system
Handling errors
JSON in 5 minutes
Case Study: Implementing a Generic Stack
Cross-compile C/C++ and Zig programs
Comptime
Where data is stored and how to choose an allocator
Strings in 5 minutes

NEXT.JS

Handle Optional Subpath

SCALA

Partial Applied Function