JS is very nice when
- Mobile and desktop UI are very different
- Easier to have 2 distinct HTML structure (cards vs table, burger menu vs horizontal menu) instead of having one and use media queries
- To display/hide things
JS allows for:
JS is very nice when
JS allows for:
The Cube Editor is a very nice bike, unfortunately the Alfine 11 lower gear is not low enough for touring, let's fix that!
Bike web page: https://info.cube.eu/product?a=855400
| import assert from 'node:assert/strict'; | |
| /** | |
| * Parses a string containing environment variables and returns a map of key => value pairs. | |
| * | |
| * The string format is `KEY=VALUE` pairs separated by new lines; | |
| * it typically comes from UNIX command `printenv` or `env`. | |
| */ | |
| export function parseEnv(env: string) { | |
| const lines = env |
flowchart TD
format["What image format to use?"] --> source{"Analog or digital source?"}
source -- "analog<br>(photo from a camera)" --> jpeg["JPEG lossy<br><br>(also AVIF, WebP, HEIF/HEIC, JPEG XL...)<br><br>Like MP3 format</span>"]
source -- "digital<br>(using a software to draw the picture)" --> staticOrAnimated["Static or animated?"]
staticOrAnimated -- "static" --> vectorOrRaster{"Can you make it scalable (vector based)?"}
staticOrAnimated -- "animated" --> gif["GIF<br><br>(also APNG, AVIF, WebP, MNG, HEIF, video formats like MP4...)"]<svg xmlns="http://www.w3.org/2000/svg" />| /* eslint-disable unicorn/no-null */ | |
| /* | |
| * Resetting window.location between tests is unfortunately a hard topic with JSDOM. | |
| * | |
| * https://gist.github.com/tkrotoff/52f4a29e919445d6e97f9a9e44ada449 | |
| * | |
| * FIXME JSDOM leaves the history in place after every test, so the history will be dirty. | |
| * Also its implementations for window.location and window.history are lacking. | |
| * - https://github.com/jsdom/jsdom/blob/22.1.0/lib/jsdom/living/window/Location-impl.js |