Code to keep.
Small solutions to familiar problems. A collection of snippets to save you a little time on your next build.
- React
Some reusable code snippets in JSX
Certainly! Here are some reusable code snippets in JSX that can help streamline your React development.
Read snippet → - Spotify
Getting Spotify token to display now playing track on your website
How to get Spotify token and use it to display now playing track on your website
Read snippet → - Typescript
String Casing Utilities in JavaScript
Useful string casing utility functions in JavaScript
Read snippet → - Git
How to safely rename a case sensitive file/directory in a git repo?
Learn how to safely rename a case-sensitive file or directory in a Git repository.
Read snippet → - Typescript
Remove all falsy values from an object and its nested children
Remove all falsy values from an object and its nested children in JavaScript and TypeScript
Read snippet → - React
A custom hook to use an async effect
Learn how to create and use a custom hook to handle asynchronous side effects in React.
Read snippet → - Javascript
Check if a string is a valid color
A simple JavaScript utility to check if a string is a valid CSS color.
Read snippet → - Bash
Find which process is running on a certain port and kill it
Quickly find and kill processes running on specific ports in MacOS using terminal commands.
Read snippet → - Markdown
Markdown Code block's basic and advanced syntaxes
Learn the basic and advanced syntax for code blocks in Markdown, including language highlighting, filenames, and line numbers.
Read snippet → - Javascript
Simple Event-Emitter/PubSub Pattern
A simple implementation of the Event-Emitter or PubSub pattern in JavaScript.
Read snippet → - Liquid
Adding/subtracting days in Shopify's Liquid template language
Adding/subtracting days in Shopify's Liquid template language
Read snippet → - Bash
Read all file names in a directory
Learn how to quickly read and list all file names in a directory using Node.js
Read snippet → - Javascript
Replace all VNese letters with the corresponding English accents
Learn how to replace Vietnamese diacritic letters with their plain English equivalents using JavaScript and regex.
Read snippet → - Git
Ignore all files in a directory except a specific file
Learn how to ignore all files in a directory except a specific file using .gitignore
Read snippet → - React
A custom hook to use local storage state
Learn how to create and use a custom hook that syncs state with local storage in React.
Read snippet →