Skip to content

Instantly share code, notes, and snippets.

@calvingiles
Forked from friggeri/haiku
Last active August 29, 2015 14:04
Show Gist options
  • Save calvingiles/e3ea11eb5b09d8408d3b to your computer and use it in GitHub Desktop.
Save calvingiles/e3ea11eb5b09d8408d3b to your computer and use it in GitHub Desktop.
python function to generate heroku-like names
import random
def get_haiku(n_adj=1, sep='-'):
'''
return short haiku, seperated by sep.
Original from https://gist.github.com/afriggeri/1266756
'''
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
"polished", "ancient", "purple", "lively", "nameless"
]
nouns = [
"waterfall", "river", "breeze", "moon", "rain", "wind", "sea", "morning",
"snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn", "glitter",
"forest", "hill", "cloud", "meadow", "sun", "glade", "bird", "brook",
"butterfly", "bush", "dew", "dust", "field", "fire", "flower", "firefly",
"feather", "grass", "haze", "mountain", "night", "pond", "darkness",
"snowflake", "silence", "sound", "sky", "shape", "surf", "thunder",
"violet", "water", "wildflower", "wave", "water", "resonance", "sun",
"wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper",
"frog", "smoke", "star"
]
parts = list({random.choice(adjs) for _ in range(n_adj)})
parts.append(random.choice(nouns))
return sep.join(parts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment