Topics /

Web & Frontend

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

2019
211

How to use array reduce for more than just numbers

The array reduce method is really powerful. But people often run into trouble as soon as they step beyond the basic examples. Simple things like addition and multiplication are fine. But as soon as you try it with something more complicated, it breaks. Using it with anything other than numbers starts to get really…

219

Unintuitive JSON Parsing

Despite the goal of JSON being a subset of JavaScript — which it failed to achieve (update: this was fixed ) — parsing JSON is quite unlike parsing a programming language. For invalid inputs, the specific cause of error is often counter-intuitive. Normally this doesn’t matter, but I recently ran into a case where it…

223

Size visualization of Go executables using D3

Note The latest version of this document can be found online at https://dr-knz.net/go-executable-size-visualization-with-d3.html. Alternate formats: Source, PDF. Note Erratum (2019-04-02): The increase in binary size from CockroachDB v1.0 to v19.2 is 94%/125%, not 194%/225% as initially written. The increase in source…

226

Chinese Window Lattice and CSS

谁向云端着此亭,檐前树木映窗棂。 -- 释绍嵩《陪赵知府登桃岭山亭》 (image from 中国窗棂) The traditional Chinese window lattice has a symmetrical beauty, as well as a very beautiful formal name -- 窗棂.

236

Firefox Local Files Theft – Not Patched Yet

Recently, I was performing a research on Same Origin Policy attacks, I managed to realize that the la version of Firefox (currently 67) is vulnerable to local files theft attack (on any supported OS), due to improper implementation of Same Origin Policy for file scheme URIs. Let’s go over the PoC details then I will…