Skip to content

Instantly share code, notes, and snippets.

@vpnry
vpnry / rename_url_encodes.py
Created February 10, 2024 09:22
To rename files according to its parent dir name. Directory names are URL encoded
# rename files according to its parent dir name
# directory names are URL encoded
# generated with CHATGPT (tested)
import os
from urllib.parse import unquote
# Function to decode URL encoded folder names
def decode_folder_name(folder_name):
return unquote(folder_name)
@vpnry
vpnry / translate_prompt.txt
Last active February 24, 2025 03:34
Prompt and script to prepare chunk for AI translation
Your role is a professional translator specializing in Theravada Buddhist texts, with expertise in translating from Sinhala into English. Your translations prioritize accuracy in conveying both the literal meaning and the deeper spiritual context of the original text. You strive to maintain the nuances and technical terminology specific to Theravada Buddhism while making the text accessible to English readers.
Your translation will be used in a book print. When translating, adhere to these guidelines:
- 1. Provide only the accurate translation of the input text without additional explanations or commentary.
- 2. Preserve important Sinhala Pali term in Roman script or other terms in transliteration when an exact English equivalent doesn't exist.
- 3. Maintain the tone and style of the original text as much as possible.
- 4. Maintain the original markdown format and preserve paragraph breaks and segments
- 5. Use consistent terminology throughout the translation, especially for key Buddhist concepts.
- 6. If
@vpnry
vpnry / a-wotd-custom-word-list.md
Created October 20, 2025 07:20 — forked from jsomers/a-wotd-custom-word-list.md
How to use a custom word list with OS X's "Word of the Day" screensaver

OS X's "Word of the Day" screensaver is a great way to passively learn words:

But I've always thought that its word list kind of stunk—it was full of obscure words that I could never really see myself using. I'd prefer something like Norman Schur's 1000 Most Important Words. What if you could plug your own word list into the screensaver?

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510	quinsy