area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr
The spec calls these void elements. These do not require a closing slash.
| #!/bin/sh | |
| if test "$(git rev-parse --abbrev-ref HEAD)" = "main" | |
| then | |
| echo "error: cannot commit to main" | |
| exit 1 | |
| fi |
| // A promise queue | |
| const q = [] | |
| const add = (task) => { | |
| let handlers; | |
| const p = new Promise((...args) => (handlers = args)); | |
| q.push({task, handlers}); | |
| if (q.length == 1) next(); | |
| return p; |
| <!-- npm create vue@latest, VSCode install Volar --> | |
| <script setup> | |
| import { reactive } from "vue"; | |
| import { ref } from "vue"; | |
| const counter = reactive({ | |
| count: 0, | |
| }); | |
| const someClass = ref("some"); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Paths</title> | |
| </head> | |
| <body> | |
| <input type="file" /> | |
| <script> | |
| const input = document.querySelector("input") |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
| <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"> --> | |
| <title>Stream</title> | |
| </head> | |
| <body> | |
| <button id="send">Send</button><br/> |
Last verified to work with Xcode 15.1.
Ten years later and I still find myself doing this on a new machine. I'd written a script and gist-ed it earlier to save myself time on new machines, but that script and gist got lost to the sands of time, so here's another one.
Open
~/Library/Developer/Xcode
| /// All the ways to zip. | |
| /// | |
| /// The Swift standard library doesn't seem to have a way to cycle an element so | |
| /// that it can be paired with something else in a zip. These are the ways I've | |
| /// found to achieve the same effect. The last one, `.map({($0, z)})` might be | |
| /// the most idiomatic Swift (and is also the shortest one to express in Swift). | |
| let xs = [1, 2, 3] | |
| let y = 1...10 |
| // Persist the scope window's position across restarts (by default, | |
| // it always starts centered on the screen on each restart). | |
| // | |
| // Usage | |
| // ----- | |
| // | |
| // Open the Stethoscope in your startup file, e.g. | |
| // | |
| // s.scope; | |
| // |