It’s been a busy week, and I’ll be writing up my WWDC thoughts and a couple of TUAW posts after a plane ride today. In the meantime, I made you a thing.
This quick function is part of a script I wrote to generate multiple files filled with random Markdown lipsum with an index for Marked testing.
Numbered files are boring, and truly random character sequences aren’t much fun. Aspell has a master dictionary that happens to contain a lot of potentially funny words. I decided to dump those and randomly pick two to string together as filenames.
The function uses a dictionary file (single word per line) and shuf, available through Homebrew in the Gnu coreutils package (brew install coreutils). You can create a dictionary file using Aspell (brew install aspell) with the command aspell dump master > dictionary.txt (or just grab the one I made). Be sure to edit the “wordfile” variable in the function to point to the location of your dictionary.
For the try-before-you-buy fans, here are sample results using the Aspell dictionary: