A few Ruby snippets for scripters

1 · Brett Terpstra · Dec. 23, 2023, 6:34 p.m.
I do most of my automation and string manipulation scripting using Ruby. I know it’s not the most popular language these days, but it’s the one I know the best (thanks to my days of hacking on TextMate bundles) and it’s usually the fastest way for me to solve a problem. I have reams of snippets saved (and easily accessible with Snibbets) and thought I’d share a few that are useful for everyday scripting on macOS. Scrub Scrub uses the encode function to switch a string to UTF-16 discardi...