Home

JavaScript

Mapping Dynamic Object Keys in TypeScript

Dynamic property maps are a super powerful paradigm in JavaScript, but they can be tricky to type correctly with TypeScript.

May 20, 2022

Use Dynamic Property Maps over Switch Case Statements

An everyday JavaScript pattern to avoid clunky switch-case statements and unnecessary if conditionals.

May 19, 2022

Run JavaScript Script Before Another Script

Automatically run scripts with NPM/Yarn before or after another script.

May 09, 2022

Extract Twitter Handle from URL with JavaScript

Code snippet that extracts a Twitter user handle from a valid Twitter URL using JavaScript.

May 04, 2022

Convert Markdown Image to HTML in VS Code

Make a bulk conversion of markdown images to HTML strings using a regex find and replace with VS Code.

May 03, 2022

Extract GitHub Repo Name from URL using JavaScript

Quick JavaScript/Node snippet that can pul a GitHub repo path from a full GitHub URL.

Apr 20, 2022

Generate Meta Images for Blog Posts with Node.js

Manually creating images for blog posts can be super time-consuming. Here's the foundation necessary for automatically generating meta images for content in markdown files.

Oct 08, 2021

Generate Random Markdown Files with Node

When writing some script or program that works with markdown files, it's nice to not have to generate them manually. Here's a script to get the job done for you.

Oct 07, 2021

Run Loop n Times in JavaScript

Quick snippet to run some function n times using JavaScript.

Oct 06, 2021

5 Reasons I'm Excited about Astro

Astro is the new static site generator on the scene. This is why I'm so excited about it.

Aug 24, 2021