Tuan Anh (Leo)

Tuan Anh (Leo)

How (and why) to parse a function from a string in JavaScript/TypeScript

Đăng ngày 6/13/2025

Safely send JavaScript functions from your server to your client by serializing them as strings, then parsing them back into callable functions on the client side.

Đọc trên blog của tác giả

Enhance Github Copilot code generation with custom instructions

Đăng ngày 6/11/2025

How I use GitHub Copilot in VS Code, along with my own custom instructions, to boost productivity, keep my code consistent, and make writing (and coding) more fun!

Đọc trên blog của tác giả

How to disable popup showing accented characters when press and hold a key on macOS

Đăng ngày 5/7/2025

How to disable popup showing accented characters when press and hold a key on macOS.

Đọc trên blog của tác giả

Shopify Hydrogen Codegen Configs

Đăng ngày 3/17/2025

How to configure Shopify Hydrogen Codegen to automatically generate types for your GraphQL queries.

Đọc trên blog của tác giả

Shopify Hydrogen: build a fully functional price range filter component

Đăng ngày 3/13/2025

A detailed guide on how to build a fully functional price range filter component for collection pages in Shopify Hydrogen.

Đọc trên blog của tác giả

Macos command to zip files and directories into a single file.

Đăng ngày 3/11/2025

Macos command to zip files and directories into a single file.

Đọc trên blog của tác giả

Relative time-ago parsing in TypeScript

Đăng ngày 3/11/2025

A simple utility function to parse relative time-ago into human-readable format.

Đọc trên blog của tác giả

Crawling Goodreads books data in Node.js

Đăng ngày 11/7/2024

Crawling Goodreads books data from user's RSS feed and parse to JSON in Node.js

Đọc trên blog của tác giả

Minimal setup list for web developers on a fresh macOS install

Đăng ngày 10/22/2024

Having a new Mac device is always exciting for every developer, but it can also be challenging, especially when it comes to setting up a new dev environment. Here is a list of the minimal setup you need to get started with web development on a fresh macOS install.

Đọc trên blog của tác giả

Enhance Github security by connecting using Secure Shell Protocol (SSH)

Đăng ngày 10/14/2024

Using the SSH protocol, you can connect and authenticate to remote Github servers and services without supplying your username and personal access token at each visit.

Đọc trên blog của tác giả

How to create an image with blurry loading effect in NextJS

Đăng ngày 10/12/2024

NextJS has provided a built-in image component that has many useful features, we can leverage them with some custom styles to create a beautiful image with a blurry loading effect.

Đọc trên blog của tác giả

Pnpm aliases

Đăng ngày 10/11/2024

How to install and update pnpm, create a shell alias for it, and upgrade project dependencies efficiently.

Đọc trên blog của tác giả

VSCode settings and keyboard shortcuts

Đăng ngày 10/11/2024

My personal VSCode configurations, settings, and key bindings that I use across all my devices.

Đọc trên blog của tác giả

How to get your Namecheap private email to work with Vercel DNS

Đăng ngày 10/8/2024

A step by step guide on how to get your Namecheap private email to work with Vercel DNS.

Đọc trên blog của tác giả

On Tailwind CSS arbitrary values

Đăng ngày 10/4/2024

How to use arbitrary values in Tailwind CSS to create custom styles for your components. Some nice tips to make your Tailwind CSS workflow more efficient.

Đọc trên blog của tác giả

Common npm commands to use locally

Đăng ngày 9/26/2023

Essential npm commands for local development, covering package installation, version control, and script management.

Đọc trên blog của tác giả

Does JavaScript Promise.all() run in parallel or sequential?

Đăng ngày 9/4/2023

JavaScript is a single-threaded programming language, so it can't run multiple things at the same time, Promise.all() actually runs promises concurrently, not in parallel!. Let's dive in to see how it works.

Đọc trên blog của tác giả

Simple way to handle route submission in a Remix app

Đăng ngày 9/4/2023

Create a custom hook to manage in-route form submissions in a Remix app.

Đọc trên blog của tác giả

Verifying Github webhooks requests in Node.js

Đăng ngày 7/9/2023

Verify and process incoming GitHub webhooks. How to set up listeners, validate requests, and handle Github's webhook events.

Đọc trên blog của tác giả

How to work with Spotify's API to display currently playing track on a website?

Đăng ngày 4/6/2023

Retrieve a Spotify access token to display the currently playing track on your website or application.

Đọc trên blog của tác giả

Eliminating Render Blocking CSS and measuring page rendering time with Performance API

Đăng ngày 3/11/2023

Learn how to improve your website's performance and enhance user experience by avoiding render blocking CSS. Using the Chrome Performance API to measure and optimize page rendering time.

Đọc trên blog của tác giả

Migrate your Shopify store assets to a new store using File API

Đăng ngày 2/25/2023

Learn how to migrate your assets from an old Shopify store to a new one in a few simple steps. This guide will show you how to retrieve and download your images using GraphQL and Node.js, and upload them to your new store with ease.

Đọc trên blog của tác giả

String casing utilities in JavaScript

Đăng ngày 2/21/2023

A various ready-to-use string casing utilities in Typescript.

Đọc trên blog của tác giả

Introduction to Committing with Conventional Commit

Đăng ngày 1/1/2023

Conventional commit is a specific form of committing which gives software developers a uniform system for organizing and describing their changes, making it easier to keep track of updates

Đọc trên blog của tác giả

Better responsive images with srcset and sizes attributes

Đăng ngày 10/25/2022

A guide to using the srcset and sizes attributes to create responsive images

Đọc trên blog của tác giả

How to safely rename a case sensitive file/directory in a git repo?

Đăng ngày 10/11/2022

Safely rename case-sensitive files or directories in a Git repository to avoid conflicts or case inconsistencies.

Đọc trên blog của tác giả

Remove all falsy values from an object and its nested children

Đăng ngày 9/21/2022

Recursively removes all falsy values (null, undefined, 0, false) from an object and its nested properties.

Đọc trên blog của tác giả

How to create an HTTPS server in localhost?

Đăng ngày 3/5/2022

The simplest way to set up an HTTPS server in Nodejs application when developing locally

Đọc trên blog của tác giả

A custom hooks to use an async effect

Đăng ngày 2/22/2022

Build a custom React hook to use asynchronous effects inside functional components.

Đọc trên blog của tác giả

Validate if a string is a valid color

Đăng ngày 10/12/2021

Validate strings to ensure they represent valid colors in various formats (hex, RGB, and named colors).

Đọc trên blog của tác giả

Mastering Section Rendering APIs in Shopify Online Store 2.0

Đăng ngày 9/23/2021

Learn how to leverage Section Rendering APIs to improve your Shopify store's performance and create dynamic, context-specific sections. Discover tips for querying dynamic section markup, including product and collection context

Đọc trên blog của tác giả

Find which process is running on a certain port and kill it

Đăng ngày 9/9/2021

Identify and terminate processes running on a specific port in your dev environment.

Đọc trên blog của tác giả

Markdown Code block's basic and advanced syntaxes

Đăng ngày 9/9/2021

A detailed overview of Markdown code block syntaxes, covering both basic and advanced use cases.

Đọc trên blog của tác giả

Simple Event-Emitter/PubSub pattern

Đăng ngày 9/6/2021

A lightweight pub/sub mechanism to handle custom events without adding a full-blown library.

Đọc trên blog của tác giả

Embedding scripts in web pages made easy with Github and jsDelivr

Đăng ngày 9/5/2021

Learn how to embed scripts and styles in your web pages without the need to modify your site's existing code. Use Github to host your script and style files, and jsDelivr as a CDN to deliver them to your web page.

Đọc trên blog của tác giả

Adding/substracting days in Shopify's Liquid template language

Đăng ngày 8/29/2021

How to manipulate dates (adding, subtracting, and formatting, etc) in Shopify's Liquid template language.

Đọc trên blog của tác giả

Read all file names in a directory

Đăng ngày 8/28/2021

A quick utility to read all file names in a directory using Node.js.

Đọc trên blog của tác giả

Replace all VNese letters with the corresponding English accents

Đăng ngày 8/28/2021

Convert Vietnamese text to plain English by replacing accented characters with their equivalents.

Đọc trên blog của tác giả

Ignore all files in a directory except a specific file

Đăng ngày 8/27/2021

How to ignore all files in a directory except for a specific one.

Đọc trên blog của tác giả

Synchronize React component state with local storage

Đăng ngày 8/27/2021

Utilize a custom hook that syncs state with local storage, allowing for persistent state between sessions.

Đọc trên blog của tác giả

Prevent layout shift when toggling scrollbar on Window

Đăng ngày 8/16/2021

When toggling the scrollbar on the Window, the layout shifts. This is because the scrollbar is added to the Window. How to prevent this with CSS?

Đọc trên blog của tác giả

Key notes while working with git

Đăng ngày 8/12/2021

Key notes to save plenty of time while working with git for command-line-developer

Đọc trên blog của tác giả

Drag and Drop API keynotes

Đăng ngày 10/25/2020

Some keynotes to keep in mind when working with Drag and Drop APIs in Javascript

Đọc trên blog của tác giả

Tricky use case of Array.prototype.map in JS

Đăng ngày 9/22/2020

If you are familiar with functional programming, Array.prototype.map must be a function that you work with every day. We encountered a tricky use case of it at Cốc Cốc recently, it took me a while to figure out, and here's the answer...

Đọc trên blog của tác giả

When to use Function Declaration vs Function Expression in JavaScript?

Đăng ngày 9/17/2020

Learn about the differences between Function Declaration and Function Expression in JavaScript, including their definitions, hoisting behavior, and when to use each method.

Đọc trên blog của tác giả

Integrating Tailwind CSS into a React Application

Đăng ngày 8/31/2020

Tailwind CSS is a low-level CSS framework that’s highly customizable. Unlike other frameworks that focus on pre-designed components like buttons, cards, or modals, which are easy to start with but hard to customize later, Tailwind lets you build your own designs from scratch using utility classes...

Đọc trên blog của tác giả

Simplify your Node.js project with module aliases

Đăng ngày 8/27/2020

Tired of dealing with complex file paths in your Node.js project? Learn how to set up module aliases using TypeScript and module-alias package to simplify your imports and improve your development experience.

Đọc trên blog của tác giả

How to make HTTP requests in Node.js without installing external libraries

Đăng ngày 8/18/2020

Learn how to make HTTP requests in Node.js without adding unnecessary dependencies to your project using the built-in https module. Follow these simple steps to easily fetch JSON data from external APIs and servers.

Đọc trên blog của tác giả

[Part 2] How should developers look for a new job - Interview, negotiate, and find a good company

Đăng ngày 7/31/2020

What’s the dev interview process like? How do you negotiate a good salary and find the right company to grow your career...

Đọc trên blog của tác giả

[Part 1] How should developers look for a new job - Building a profile

Đăng ngày 7/28/2020

The demand for IT recruitment is very high. As a software engineer, what should you prepare to get a good job and always be sought after by recruiters...

Đọc trên blog của tác giả

[Part 2] Deploy and configure your website on Namecheap in the simplest way

Đăng ngày 4/25/2020

In the previous part, I guided you through buying and connecting your domain to hosting, and activating the SSL Certificate. In this part, I’ll show you how to push your code to the server to get your website live...

Đọc trên blog của tác giả

[Part 1] Deploy and configure your website on Namecheap in the simplest way

Đăng ngày 4/23/2020

I’ve always wanted to have my own personal site, but due to lack of time, I only got to work on it recently during my stay-at-home time...

Đọc trên blog của tác giả