- Install GPG tools
- Install GPG tools and setup pin entry by running:
brew install gnupg pinentry-mac mkdir -m 700 -p ~/.gnupg echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf killall gpg-agent
| /* 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 |
| # Make a self-signed private/public keypair usable for HTTPS, including SAN / Subject Alternative Name and CN / Common Name, non-interactively and without additional files | |
| # Parentheses around the command spin it up in a subshell so that the FQDOMAIN variable is local to execution and doesn't persist after it's created | |
| (FQDOMAIN="example.local" && openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_cert.pem -outform PEM 2>/dev/null) | |
| # Alternatively, if you're setting FQDOMAIN somewhere else, you can just run directly: | |
| openssl req -x509 -nodes -newkey rsa:4096 -keyout server_key.pem -keyform PEM -days 365 -subj "/CN=${FQDOMAIN}" -addext 'basicConstraints=CA:FALSE' -addext "subjectAltName=DNS:${FQDOMAIN}" -addext 'keyUsage=digitalSignature' -addext 'extendedKeyUsage=serverAuth' -out server_ |
| import * as path from 'path'; | |
| import * as url from 'url'; | |
| function forEachDeep(obj, cb, options = { depth: 6 }) { | |
| (function walk(value, property = undefined, parent = null, objPath = []) { | |
| return value && typeof value === 'object' && objPath.length <= options.depth | |
| ? Object.entries(value).forEach(([key, val]) => | |
| walk(val, key, value, [...objPath, key]) | |
| ) | |
| : cb([property, value], parent, objPath); |
| #!/usr/bin/osascript -l JavaScript | |
| // ^^^^ COMMENT/REMOVE THIS SHEBANG IF RUNNING FROM SCRIPT EDITOR!!!!! ^^^^^^^^^^^ | |
| // The SHEBANG is only needed if the file is executable and is run from a terminal with `./RsyncBackup.js` | |
| // 1. In MacOS Spotlight type 'Script Editor' and paste the code below | |
| // 2. Click the top-left dropdown which says 'AppleScript' and select 'JavaScript' | |
| // 3. Under menu File pick Export | |
| // 4. In the Export dialog select File Format = Application | |
| // 5. Save the app in /Applications |
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
| <html> | |
| <head> | |
| <script type="text/javascript" | |
| src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"> | |
| </script> | |
| </head> | |
| <body> | |
| <cast-media-player id="player"></cast-media-player> | |
| <script> | |
| const context = cast.framework.CastReceiverContext.getInstance(); |
| #!/usr/bin/env bash | |
| # Easier navigation: .., ..., ...., ....., ~ and - | |
| alias ..="cd .." | |
| alias ...="cd ../.." | |
| alias ....="cd ../../.." | |
| alias .....="cd ../../../.." | |
| alias ~="cd ~" # `cd` is probably faster to type though | |
| alias -- -="cd -" |