Hugo Di Francesco

Hugo Di Francesco @hugo__df

About: Developer, JavaScript, CSS and web. Writing at Code with Hugo.

Location:
London
Joined:
Jan 10, 2017

Hugo Di Francesco
articles - 81 total

Celebrating the publication of "Professional JavaScript" with the Dev.to family

"Professional JavaScript" (which I've a co-authored), has recently been published with Packt, it's cu...

Learn More 19 3Oct 20 '19

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

How to use Yarn Workspaces to manage applications/coding examples. Lerna isn’t required when you d...

Learn More 11 0Sep 24 '19

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

JavaScript import/require module testing do’s and don’ts with Jest The example repository is avail...

Learn More 11 0Sep 13 '19

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

Hugo “The world’s fastest framework for building websites” is a great option for JAMStack (JavaScript...

Learn More 8 0Sep 11 '19

JavaScript Data Type Check Cheatsheet

JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programm...

Learn More 14 0Sep 1 '19

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

How to set Tailwind CSS up with a static site hosted on Netlify See the full starter repository at...

Learn More 10 0Aug 5 '19

Jest exclude file/function/statement from test coverage

In computer science, test coverage is a measure used to describe the degree to which the source code...

Learn More 8 0Jun 14 '19

How long is a new feature/page expected to take?

One of my mentees just asked me "When working for a company, what is the expected timeline for a new...

Learn More 7 2Jun 9 '19

Super-powered newsletter content with Pocket and Netlify Lambda

An example Netlify Lambda to fetch all “newsletter” posts from Pocket. Pocket is an application an...

Learn More 7 1Jun 8 '19

Avoiding recursion pitfalls: MongoDB nested query clause addition and removal

A case-study on where recursion can be useful for enterprise Node.js applications and how to avoid it...

Learn More 6 0May 31 '19

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

When asked to handle data in a request body, developers who have used Express (th...

Learn More 8 0May 24 '19

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

With Jest it’s possible to assert of single or specific arguments/parameters of a mock function call...

Learn More 6 0May 18 '19

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

The why and how of enterprise-style Node.js application. A setup that’s easy to test and extend using...

Learn More 62 6May 10 '19

Add days to a Date in vanilla JavaScript

Despite the JavaScript Date warts, it’s straightforward to add days to a date in JavaScript. While i...

Learn More 11 3May 3 '19

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

Static site generators like Hugo, Jekyll, Hexo, Gatsby or other JAMstack alternative are a great opti...

Learn More 7 0Apr 23 '19

Enable CDN (Cloudflare) caching for your Netlify site

This post goes through how to reduce the amount of static assets served through Netlify by leveraging...

Learn More 13 0Apr 14 '19

Docker Compose Local HTTPS with nginx or Caddy

A solution to serve your Dockerized application on Docker Compose with TLS/SSL locally by leveraging...

Learn More 18 0Mar 25 '19

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

Settling on a Netlify + Dokku on DigitalOcean (for US) or Hetzner Cloud (for EU) deployment stack fo...

Learn More 11 3Apr 11 '19

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

This post goes through how to use Object.defineProperty to mock how constructors create methods, ie....

Learn More 8 0Apr 9 '19

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

When working with git a selection of GitLab, GitHub, BitBucket and rebase-trigg...

Learn More 7 0Mar 25 '19

Pass cookies with axios or fetch requests

When sending requests from client-side JavaScript, by default cookies are not passed. By default, f...

Learn More 10 1Mar 6 '19

Parse POST/PATCH/PUT request JSON body with Express and no dependencies

When asked to handle data in a request body, developers who have used Express (the “Fast, unopinionat...

Learn More 8 0Feb 25 '19

A guide to Express request and response mocking/stubbing with Jest or sinon

To test an Express handler, it’s useful to know how to successfully mock/stub the request and respons...

Learn More 19 0Feb 18 '19

12-factor Node.js application configuration management without the `config` npm package

The config npm package is great (npmjs.com/package/config), but it encourages confusing and non-12-fa...

Learn More 16 2Feb 13 '19

The comprehensive guide to integrating a Python/Ruby/PHP/shell script with Node.js using child_process.spawn

There are occasions when running a Python/Ruby/PHP shell script from Node.js is necessary. This post...

Learn More 6 0Feb 4 '19

Async JavaScript: history, patterns and gotchas

A look at the history, patterns and gotchas of asynchronous operations in JavaScript. We’ll go throu...

Learn More 12 0Jan 28 '19

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

The Dokku mongo plugin provides a mongo:connect command, which opens a tunnelled connection to you Mo...

Learn More 5 3Dec 31 '18

Sequelize Data Types: a practical guide

DataTypes are core to the Sequelize 4 library. This is a practical and complete guide to make up for...

Learn More 13 0Dec 19 '18

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

tl;dr : here are the tools used to power, build and publish codewithhugo.com: Dropbox Paper becaus...

Learn More 12 2Dec 7 '18

Post Frequency: from prototype to production with Vue + Node

If you want to ship, use the tools you know. — A lot of people Let’s apply that principle: I’m bui...

Learn More 9 0Nov 26 '18