Topics /

Web & Frontend

The most popular blog posts about web & frontend on Hacker News. 268 posts.

2019
186

Preload, prefetch and other link tags

There’re lots of ways to improve web performance (see Web Performance 101 for a full overview). One of those ways is to preload content you’ll need later in advance. Prefetch a CSS file, prerender a full page, or resolve a domain ahead of time – and you won’t have to wait for it when it’s actually needed! Sounds cool.

188

Coping with Flexbox

If only someone paid me everytime I visited CSSTrick's flexbox guide…or at least all those times when I fiddled around {justify,align}-{content,items} trying to make _something_ happen on screen. I wanted to form a better mental model of all the basic functionality that flexbox provides for all those…

189

A horrifying globalThis polyfill in JavaScript

The globalThis proposal introduces a unified mechanism to access the global this in any JavaScript environment. It sounds like a simple thing to polyfill, but it turns out it’s pretty hard to get right. I didn’t even think it was possible until Toon blew my mind with an unexpected, creative solution.

190

Lorem Picsum, death by a million pixel-gigabits

Updated 2023-04-16 Or how to serve half a billion placeholder images a month on a budget. Lorem Picsum is one of the most popular placeholder sites on the internet. It started as a small side project written in NodeJS five years ago to cover my own needs and has since gone through several iterations as it has grown…

195

Twitter accounts are being hijacked for spam

It seems that Twitter has lost control of its advertising system. This blog post will show you why it is dangerous to click on any Twitter advertising. Twitter ads have always been a bit crap, but I've seen a recent influx in outright scams. Let me step you through a couple of examples. A typical click-bait headline…

198

Writing Hello World in Web Assembly (2017)

Web Assembly is written in an s-expression syntax (wast) and then needs to be translated down to binary encoded wasm. Below is a gist of wast that imports the stdlib.print function taking a memory location offset and a length, as well as importing a block of memory from the controlling runtime. We then store the…

203

Serverless collaborative editor using CRDT

Previously I've worked on a collaborative tool, which worked like Google Docs. This project was called crepl . Because I stopped paying for hosting of its server, that project is now offline. That made me consider: what if a collaborative editor wouldn't need a server?

206

Animating CSS Grid

Soooo, Jen Simmons just dropped a surprise bombshell on Twitter – CSS Grid grid-template-columns and grid-template-rows properties are now animatable in Firefox Nightly! Naturally I had to jump in and have a go right away!

208

Racket for E-Commerce

I had originally shared a version of this post with a small, private mailing list, but then I figured there'd be no harm in sharing it with a larger audience so here it is.