This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import random, sys | |
# define our list of candidate snippets | |
s = ["%snippet:typo1%","%snippet:typo2%","%snippet:typo3%"] | |
# select one at random and write it to STDOUT | |
sys.stdout.write(random.choice(s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reshape[list_, dimensions_] := | |
First[Fold[Partition[#1, #2] &, Flatten[list], Reverse[dimensions]]] |