This Web Components keeps the year in your copyright notice up-to-date.
export { CopyrightYearElement }
const name = "copyright-year";
class CopyrightYearElement extends HTMLSpanElement {
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
// sh.mjs: javascript shorthand | |
// array helpers (apl/j/k) | |
export const id=x=>x | |
export const af=(n,x)=>Array(n).fill(x) // TODO: make this 'afl' or 'fil' (aa?) | |
export const ii=(n,f)=>{for(let i=0;i<n;i++)f(i)} | |
export const im=(n,f)=>af(n,0).map((_,i)=>f(i)) | |
export const ia=(n,f)=>im(n,id) | |
export const at=(a,ixs)=>ixs.map(i=>a[i]) | |
export const io=(xs,ys)=>ys.map([].indexOf.bind(xs)) |
During Setup Assistant,
Choose French as language and France as region.
Add English (US) as 2nd preferred language (to be able to search for emoji in French+English, etc.), remove any keyboard besides ABC.
In Vision settings, enable ⌃-2-fingers zoom and automatic switch between Light & Dark mode.
Don’t import any backup, connect to iCloud, create an account without touching the avatar (guarantees it’ll use iCloud’s), customize data sharing, enable FileVault, add a fingerprint for Touch ID, set up Apple Pay.
Download apps on the Mac App Store:
Pages, Numbers, Keynote, Pixelmator Pro, Final Cut Pro, Apple Configurator, 1Blocker for Safari, Supercopy for Safari, Messenger, Ivory, Mactracker, Apple Developer, TestFlight, Key Codes, Boop.
find /System/Library/LaunchDaemons /System/Library/LaunchAgents -name "*.plist" \ | |
| while read p ; do plutil -convert json -o - ${p} \ | |
| jq -r ' .. | objects | with_entries(select(.key == "Notification")) | select(. != {}).Notification' | |
done | sort -u > ~/Desktop/all-launchd-notifications.txt |
-- Make sure commandline client (/usr/local/bin/hs) is installed | |
-- and IPC module is running. | |
require("hs.ipc") | |
local logger = hs.logger.new("ipc", "info") | |
local path = "/usr/local" | |
-- On Macs with Apple chips, install cli in /opt/homebrew/ with Homebrew | |
-- as /usr/local doesn't seem to be writable. |
// Prime checking regex, which this code is based off of | |
// https://regex101.com/r/RIJkGF/1 | |
type StringDivisible<n extends string, div extends string> = n extends `` ? true : n extends `${div}${infer r}` ? StringDivisible<r, div> : false; | |
type Substrings<n extends string, d extends string = ""> = n extends `${d}${infer r}` ? readonly [` ${d}`, ...Substrings<r, ` ${d}`>] : readonly []; | |
type StringFactors<n extends string> = Substrings<n> extends readonly [unknown, ...infer R extends readonly string[], unknown] ? R : never; | |
type StringIsPrime<n extends string, Factors extends readonly string[] = StringFactors<n>> = Factors extends readonly [infer s extends string, ...infer R extends readonly string[]] ? StringDivisible<n, s> extends true ? false : StringIsPrime<n, R> : true; | |
type RepeatStringByStringDigit<str extends string, d extends string> = |