This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
def pack_ranges(s, reverse=False): | |
""" | |
>>> pack_ranges("abcdef") | |
'a-f' | |
>>> pack_ranges("acdefawuvyaxz") | |
'ac-fu-z' | |
>>> pack_ranges("ac-fu-z", reverse=True) | |
'acdefuvwxyz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx browserify file.js --full-paths --debug | npx exorcist bundle.js.map > bundle.js | |
npx source-map-explorer --no-border-checks bundle.js bundle.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import tinify # https://tinypng.com/developers/reference/python | |
import tomllib | |
from pathlib import Path | |
def main(input, output, background): | |
if output is None: | |
output = input | |
with open('.env', 'rb') as fp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import string | |
import struct | |
import subprocess | |
from pathlib import Path | |
# https://developer.apple.com/documentation/coreservices/uckeyboardlayout | |
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/UnicodeUtilities.h | |
_DefaultBundle = Path('/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd"> | |
<!-- | |
Data generated Sun Feb 26 12:35:43 2023 | |
Generated by kluchrtoxml build 203 | |
--> | |
<keyboard group="126" id="0" name="U.S." maxout="2"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage: wordle.py [-h] [-n N] [--word WORD] wordlist | |
positional arguments: | |
wordlist word list file | |
options: | |
-h, --help show this help message and exit | |
-n N, --max-attempts N | |
maximum attempts | |
--word WORD play this word |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
def main(infile, hmin, hmax): | |
'Spec: https://kramdown.gettalong.org/converter/html.html' | |
text = infile.read() | |
rx = re.compile(r'^(#+)[ \t]+(.*?)\s*$', re.M) | |
rl = re.compile(r'^[\W\d]+') | |
ru = re.compile(r'[^\w\s-]+|_') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' |
NewerOlder