Skip to content

Instantly share code, notes, and snippets.

@jaredonline
Created February 17, 2012 20:47
Show Gist options
  • Save jaredonline/1855354 to your computer and use it in GitHub Desktop.
Save jaredonline/1855354 to your computer and use it in GitHub Desktop.
hash = { ... some stuff ... }
keys = hash.keys
random_key = keys[(rand(keys.count)]
hash[random_key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment