Programming
Investigating failed Russian word lookups caused by different Unicode representations of й and correcting the input before querying SQLite.
Dynamic DNS - auto-updating from macOS
Setting up dynv6 and ddclient on macOS to keep a dynamic DNS record aligned with a home connection’s public IP address.
Fixing CodeRunner jQuery injection
Working around broken jQuery injection in CodeRunner by pointing its custom run script to a local jQuery file.
Parsing Russian Wiktionary content using XPath
Extracting stress-marked Russian headwords and definitions from Wiktionary with Python, lxml, XPath, and Beautiful Soup.
Friday, January 29, 2021
Custom aliases in oh-my-zsh
With oh-my-zsh, you can store custom aliases in multiple (?per application) file under .oh-my-zsh/custom giving them .zsh file extensions.1
¶For example, in my hugo.zsh file, I have:
alias hnewtil="/Users/alan/Documents/blog/ojisan/scripts/newtil.sh"
alias gtojisan="cd /Users/alan/Documents/blog/ojisan; ls -l;"Executing inline Python in a shell script
It’s possible using the -c command.2
python -c 'import foo; foo.bar()'Wednesday, January 27, 2021
W3schools.com has a CSS library that’s quite nice. I often use Bootstrap; but I like some of the visual features here better. For example, I like their tags because they have more flexible use of colour.
If you want to fetch from a Python dictionary, but you need a default value, this is how you do it:
upos_badge = {'noun': 'lime','verb': 'amber', 'adv': 'blue',}
badge_class_postfix = upos_badge.get(value.lower(), 'light-grey')I recently learned about DeepL as an alternative to Google Translate. It seems really good.
More on integrating Hazel and DEVONthink
Using Hazel to extract dates from bank-statement PDFs, rename the files, and import them into DEVONthink with tags.
Regex to match a cloze
A regular expression and Python example for removing Anki cloze markup while preserving the enclosed text.
Removing stress marks from Russian text
Using regular expressions to remove syllabic stress marks from Russian text.
URL-encoding URLs in AppleScript
Encoding Cyrillic URLs in AppleScript so Safari can open Russian dictionary pages without rejecting the address.