clubmate.fi

A good[ish] website

Web development blog, loads of UI and JavaScript topics

Spin down idle disks on a Raspberry PI

Here’s how to make hard disks stop after a period of idle time. Lately I’ve been dabbling around with Raspberry PIs, and I had a problem…

Force re-render function React component (or class component)

Here’s how to force a re-render on a function-style React component. Spoiler alert: it’s really simple. Why would you want to force a re…

Speed up page rendering by setting content-visibility to auto

There’s a new CSS property in town called content-visibility . It will defer the rendering of elements until they’re about to hit the…

Ping your sitemaps to Google and Bing to inform search engines about new content

You can tell Google or Bing about the changes that have happened in your site, by pinging them your changed sitemaps. "Pinging" in this case…

How to resize HTML elements: with few lines of CSS, using a React hook, or with pure JavaScript

How to resize DOM elements supers easily with pure CSS, or in a more fancy way using React lib. You know how textareas can be resized easily…

Render draft posts locally in Gatsby

This post looks how to render posts from your drafts directory in an MDX Gatsby setup. Locally only, so you don’t leak unfinished posts. I…

Make any HTML element editable with contenteditable attribute

Any element’s content can be made editable same way form fields are, even divs, by using the contenteditable attribute. You can just edit…

React data visualizations | No dependencies, just some CSS

How to make simple data plotting with pure CSS. The point I had here was not to mathematically verify anything, but just to map out the…

JavaScript: make arrays of size | how to create filler arrays of varying length

Stuff arbitrarily sized arrays with content. There are times when you need long winding arrays filled with monotonic content. Push into the…

Access random element in an array, in a short and concise manner

Get a random item from a JavaScript array. Get a random int First we need to get a random number that is an int , and isn’t too large. This…

← PreviousNext →
  • © 2021 Antti Hiljá
  • About
  • Follow me in Twatter → @hiljaa
  • All rights reserved yadda yadda.
  • I can put just about anything here, no one reads the footer anyways.
  • I love u!