javascript

Posts

Convert a JavaScript object to queryparams string

This post describes two very simple ways to convert a JavaScript object to a querystring both in a browser environment or server environment.

ESLint Global Variables

When we use some global variables defined elsewhere, eslint throws an error saying the variable is not defined. Here is how to configure eslint to ignore those.

Extend Window type with Typescript

Some of the object properties or functions are not available in the Typescript Window type. Let see a way to extend the Window type with the missing properties.

Gatsby + Netlify CMS + TailwindCSS Starter

Just created a new starter coming from some of my website development and powered with Gatsby.

How to get a React element as an HTML string

For use cases, you may want to have the generated HTML string from your React component instead of a mounted component rendered on the page. The simplest way is to use the renderToString function provided by the react-dom package.

How to manage Internationalization with NextJS SSG

Staticaly generating a website with the NextJS framework in different languages is not so obvious.

How to render emojis with JavaScript

For the content of your posts, emojis add some fun to your pages. This short post explains how to make that possible in JavaScript.

Update NodeJS with npm

New NodeJS releases are done often, so you need to keep your installation up to date. To do so, you can use your Linux distribution package manager (apt, dnf, ...) or brew for OSX. Another way is to use npm..

Snippets

Create layout with HandlebarsJS

Layout template is a good practice to not repeat ourselves (DRY). Handlebars templates engine does not provide a layout feature out of the box but it still is possible to create a layout. principle. Handlebars template engine, there is no out-of-the-box layout feature but it is possible to create a layout.

Create layout with HandlebarsJS

Typescript Project Dockerfile

A Dockerfile to build production-ready Typescript docker image.

Typescript Project Dockerfile

Rename the extension of multiple files with bash script on Mac and Linux

A bash script snippet to rename recursively multiples files extension from the current directory.

Rename the extension of multiple files with bash script on Mac and Linux