RSS.Social

Code with Hugo

follow: @[email protected]

Posts

Clear Module Cache/Force Import in Node.js with CommonJS and with ES Modules (ESM)

Taming Timezones: Replacing moment.parseZone with @date-fns/tz and Vanilla JS Date

TypeScript in the Trenches: Utility types and type manipulation patterns for application development

Configure Timezone for Jest/Node.js with the `TZ` env var

Nock on Node 18/20/22 Fails to Intercept isomorphic-unfetch/fetch Request

`dotenv` not required: load `.env` and parse env vars natively in modern Node.js

Mocking/stubbing the current Date in Jest tests

Docsify Mermaid 10

Mocking/stubbing the Date and timers (setTimeout) in Node.js tests with built-in `node:test` MockTimers

Direnv setup for multiple git/GitHub, npm and AWS accounts/credentials

Test Native `fetch` in Node.js with Undici interception and mock utils

Node Test Runner: skip a test if an environment variable is missing/empty

Lerna publish with no git commit, tag or push

What is Jest and why should I use it?

Concurrent/Parallel HTTP Requests in Go

Markdown escape backticks in inline code and fenced code blocks

git diff by word

git/GitHub CLI set editor to vim or VSCode

Node.js Native Test Runner

Tips for real-world Alpine.js

Why doesn't React.useEffect run on React server-side renders (SSR)?

Cypress Scroll Position Assertions

What is the "?." JavaScript/TypeScript operator

Convert images to data URLs at the command line (Mac OS)

The Future of PHP: Is It a Dead Programming Language?

Tips For Students Choosing Their First Programming Language

Disable a HTML <a> link/anchor tag

An accessible Alpine.js menu toggle

Alpine.js in-depth: listen to JavaScript events using x-on

Alpine.js in-depth: reactive HTML attribute binding with x-bind

Show/hide in Alpine.js with x-show

Github Pull Request Review: reset viewed files

Alpine.js In-Depth: x-data "state" & x-text "echo"

Alpine.js `x-for` a number of iterations (n times)

Alpine.js `x-for` with objects: 4 ways to iterate/loop through JavaScript objects

How to get type-checking and generate TypeScript Typing declaration (types.d.ts) from JSDoc annotations

Sync Alpine.js x-data to localStorage/sessionStorage

How to Access Alpine.js Magic Properties from inline handlers and function/component methods

Access Alpine.js component data/state from outside its scope

A guide to Alpine.js component communication

App Ideas: 17 Web Apps You Can Build To Level Up Your Coding Skills

Alpine.js + jQuery/JavaScript Plugin Integration: a Select2 example

JavaScript remove duplicates, get unique/distinct values from Array with ES6+ Set and spread

AVA: pass or fail a test if an environment variable is missing/empty

Use microbundle for a TypeScript npm module

Add days to a Date in vanilla JavaScript

Synchronize x-data and the URL in Alpine.js with the location/History APIs and $watch

Integrating Alpine.js + Pre/Server-rendered content

Integrating Alpine.js with Eleventy & YAML files to create Alpine Playground's Collections

How to migrate a bunch of HTML pages (Alpine.js Playground) to Eleventy

Practical Alpine.js: x-data data access & data fetching/AJAX examples

Run Alpine.js inside of React

Advantages and Disadvantages of Node.js

5 Reasons Why You Should Learn Programming

Managing Your Videos With HTML and JavaScript

Catalina "Apple cannot check for malicious software" Command Line Fix

Fix "[Vue warn]: You are using the runtime-only build of Vue"

Jest set, clear and reset mock/spy/stub implementation

Jest .fn() and .spyOn() spy/stub/mock assertion reference

Jest Array/Object partial match with objectContaining and arrayContaining

Jest explicitly or arbitrarily force fail() a test

How to integrate Python/Ruby/PHP/shell script with Node.js using child_process.spawn or child_process.exec

Jest Full and Partial Mock/Spy of CommonJS and ES6 Module Imports

Importance of Blocking Web Crawlers and Bots From Your Website

How to run, ignore or skip Jest tests, suites and files

Auto-publish future posts with JAMstack on Netlify and IFTTT/CircleCI 2.0 scheduled jobs

Detect ctrl/cmd/alt/shift + Click in Vanilla JavaScript, React and Vue.js

Record analytics events with a Zeit "micro" + SQLite3 Node.js application

How to run Jest tests sequentially

Detect if the current file/module is the entrypoint or import/require-d in Node.js

Add Diagrams to your Jekyll/Hugo/Gatsby blog with Mermaid JS

Yarn Workspaces: monorepo management without Lerna for applications and coding examples

Add Search to a Hugo site with Lunr.js and Node.js

JavaScript Data Type Check Cheatsheet

Tailwind CSS 1.x impressions, development and production setup for static sites with Tailwind CLI and PurgeCSS CLI

Jest ignore or exclude file/function/statement from test coverage

Super-powered newsletter content with Pocket and Netlify Lambda

Avoiding recursion pitfalls: MongoDB nested query clause addition and removal

Read and parse POST/PATCH/PUT request JSON or form body with Express and no dependencies

Using ES6 classes for Sequelize 4 or 5 models

Jest assert over single or specific argument/parameters with .toHaveBeenCalledWith and expect.anything()

An enterprise-style Node.js REST API setup with Docker Compose, Express and Postgres

Enable CDN (Cloudflare) caching for your Netlify site

Docker Compose Local HTTPS with nginx or Caddy and mkcert

Deployment options: Netlify + Dokku on DigitalOcean or Hetzner Cloud vs now.sh, GitHub Pages, Heroku and AWS

JavaScript Object.defineProperty for a function: create mock object instances in Jest or AVA

Fix git “tip of your current branch is behind its remote counterpart” - 4 real-world solutions

Pass cookies with axios or fetch requests

A testing guide for Express with request and response mocking/stubbing using Jest or sinon

Node.js configuration management without config or dotenv

Bash Cheatsheet: check if environment variables are set or file/symlinks exists + more

Async JavaScript: history, patterns and gotchas

Connect to MongoDB on Dokku with your local command line or Robo3T

Sequelize Data Types: a practical guide

Avoid null/undefined in JavaScript arrays

JavaScript array type check - “is array” vs object in-depth

Technical content workflow for “Code with Hugo”: static site, Paper, Medium, DEV and Buttondown

Post Frequency: from prototype to production with Vue + Node

Add a Vanilla JavaScript paywall to a Hugo site using checkoutpage.co

A simple JavaScript/Node coding setup on Mac OS X

Progress and roadblocks: a journey into open-source

A tiny case study about migrating to Netlify when disaster strikes at GitHub, featuring Cloudflare

Simple, but not too simple: how using Zeit’s `micro` improves your Node applications

6 months of Code with Hugo, in numbers

Use ES modules/ES6 import in Node without Babel/Webpack using `esm`

ObservableHQ notebooks for JavaScript demos and prototypes

Impress interviewers with recursion in JavaScript with ES6 features

Writing multiple Vue components in a single file

Mocking/stubbing ES6 classes in tests with examples of Sequelize model unit tests

Why you should wrap your (JavaScript) dependencies

A gentle introduction to GraphQL API integrations

JavaScript GraphQL client requests in Node and the browser using `graphql.js`

Build and deploy a Vue/React/Vanilla JS app with Parcel and GitHub pages

Change the date of a git commit

The step-by-step guide to create a domain redirect with Cloudflare

Python GraphQL client requests example using gql

Switching the lights on: Hugo vs Hugo config files

When to use Jest snapshot tests: comprehensive use-cases and examples 📸

Deploy to multiple environments with git and CircleCI

Install just redis-cli on Ubuntu, Debian, Jessie

Bring Redux to your queue logic: an Express setup with ES6 and bull queue

ES6 by example: a module/CLI to wait for Postgres in docker-compose

Better HTTP Polling in JavaScript with RxJS 5

Responsive, semantic images with CSS

Testing an Express app with SuperTest, moxios and Jest

How to make beautiful, simple CLI apps with Node

A Docker/docker-compose setup with Redis and Node/Express

From AngularJS to Vue.js, CommonJS and Jest

Split an existing git commit

A simple, real-world Vue.js directive example

Ditch syntax highlighting for better technical writing

React vs Angular vs Vue in 2019: How components won the “framework wars”

Animations: CSS vs JavaScript

Learn git even if you don’t code

In simple terms: code on the backend, frontend and how they interact

AVA, low-config testing for JavaScript

First-class and Higher Order Functions: Effective Functional JavaScript

Closures, Partial Application and Currying: Effective Functional JavaScript

10 minute JavaScript: Library development in ES6 with Babel, Mocha and npm scripts

Recursion in JavaScript with ES6, destructuring and rest/spread

Why CSS is hard