Skip to content

Instantly share code, notes, and snippets.

@zmaril
Created June 8, 2012 15:15
Show Gist options
  • Select an option

  • Save zmaril/2896110 to your computer and use it in GitHub Desktop.

Select an option

Save zmaril/2896110 to your computer and use it in GitHub Desktop.
Generating schema
#Not valid coffeescript, but close
generate = {}
generate.ip = ()->
numbers = (Math.round(Math.random()*255)+1) for i in [0..4]
numbers.join(".")
generate.user_agent = ()->
["Mozilla","Apple","Windows","Etc"].random()
pages = ["Main","Settings","Content","About"...]
generate.sites = ()->
(page for page in pages when Math.random() < 0.5)
generate.user = (id)->
"id": id
"ip": @ip()
"user-agent": @user_agent()
"pages-visited": @pages()
users = ( generate.user() for i in [0..10000])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment