Skip to content

Instantly share code, notes, and snippets.

@jpcranford
jpcranford / Roman Numerals.applescript
Last active September 26, 2021 00:02
Some quick AppleScript handlers to convert between roman numerals and integers.
romanToInt("mcdxcii")
--> 1492
intToRoman(1492)
--> "MCDXCII"
on romanToInt(numeral)
set numeral to my TextHandlers's changeCaseOfText(numeral, "uppercase")
set n to 0
try
@jpcranford
jpcranford / avrae cheatsheet.md
Last active May 4, 2025 03:45
A handy cheatsheet and tutorial for using the Discord bot Avrae. https://avrae.io

Roll some dice: !roll 1d12+3 adv


A linked character sheet is needed to run commands in the following table.

Action Avrae command
Ability check !check perception
Initiative roll !check init
@jpcranford
jpcranford / Open scripture reference.applescript
Last active August 30, 2021 20:17
An AppleScript for opening scriptures on ChurchOfJesusChrist.org. Easily added to the right-click menu across macOS: open Automator, create new Quick Action, set input to text from any app, and add the "Run AppleScript" action with the code below.
on run {input}
--set testStringList to {"Gen. 4:7", " Eccl. 3:1,7 ", "Luke 16:1–2 (1-12)", "Moses 4:15", "D&C 121:43", "Isaiah 45:19", "Alma 38:12", " Doctrine and Covenants 122:7", "Matt. 25:21 (14-30)", "2 Kgs. 20:1 (1–6)"}
--set input to item 10 of testStringList -- LINE FOR TESTING
-- Clean up input:
set input to trimText(input, space, "both")
set input to findAndReplaceInText(input, "–", "-")
set input to findAndReplaceInText(input, "—", "-")
set book to regexSearch(input, "(.+) .+:.+")
log result
@jpcranford
jpcranford / Emberwatch Treasury.md
Last active June 22, 2021 04:01
D&D Party Inventory

Vault #59

Registered under the names of Shield-Bearer, Wolf, Juul Na'ash, Rhogar Kimbatuul, Ki Moonshadow.

From Portable Hole:

  • Loose coinage:
    • 3,100 cp
    • 3,450 sp
    • 268 gp
    • 55 pp
  • A chest, contents are individually stamped with the seal of Mornnora: