A command-line tool to view, set, and clear custom keyboard mappings on macOS using hidutil.
# View current mapping
./macos_keys.py| // ==UserScript== | |
| // @name Messenger Scraper | |
| // @namespace https://github.com/szhu | |
| // @version 0.20260429.5 | |
| // @match https://www.facebook.com/messages/* | |
| // @match https://www.messenger.com/* | |
| // @grant none | |
| // @run-at document-idle | |
| // ==/UserScript== |
| #!/usr/bin/env python3 | |
| import re | |
| import subprocess | |
| import sys | |
| def run(args, echo=True): | |
| if echo: | |
| print(f"$ {' '.join(args)}") | |
| r = subprocess.run(args, capture_output=True, text=True) |
| #!/usr/bin/env node | |
| const { execSync } = require("child_process"); | |
| const path = require("path"); | |
| const plist = path.join( | |
| process.env.HOME, | |
| "Library/Preferences/.GlobalPreferences.plist", | |
| ); | |
| const key = "NSUserDictionaryReplacementItems"; |
| // ==UserScript== | |
| // @name Prevent Input Zoom (robust) | |
| // @match *://*/* | |
| // @run-at document-start | |
| // ==/UserScript== | |
| const VIEWPORT_CONTENT = | |
| "width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"; | |
| function upsertViewportMeta() { |
| #!/bin/bash | |
| set -e | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: $0 backup|backup-and-delete|restore" | |
| exit 1 | |
| fi | |
| CMD=$1 | |
| SELF=$0 |
| #!/bin/sh | |
| # A script version of the instructions here: https://remove.codes/01-dynamic-wallpaper | |
| set -e | |
| # Helper functions. | |
| verbose() { | |
| echo >&2 | |
| echo $ "$@" >&2 |
| #!/bin/bash | |
| set -e | |
| echo "==> Formulae" && brew leaves | xargs brew deps --tree --formula | sed '/^$/d' && echo && echo "==> Casks" && brew list --cask | xargs brew deps --tree --cask | sed '/^$/d' |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| // Converts a size string (e.g., "20g", "500m", "1024") into bytes. | |
| off_t parse_size(const char *sizeStr) { | |
| char *end; |
| -- ~/.hammerspoon/init.lua | |
| ---@diagnostic disable-next-line: undefined-global | |
| local hs = hs | |
| hs.window.animationDuration = 0 | |
| -- https://github.com/Hammerspoon/hammerspoon/issues/3224#issuecomment-1294971600 | |
| local function axHotfix(win, fn) | |
| local axApp = hs.axuielement.applicationElement(win:application()) | |
| local wasEnhanced = axApp.AXEnhancedUserInterface |