Skip to content

Instantly share code, notes, and snippets.

@jcsalterego
Last active December 12, 2015 10:19
Show Gist options
  • Save jcsalterego/4757928 to your computer and use it in GitHub Desktop.
Save jcsalterego/4757928 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
num_times = (ARGV[0] || "1_000_000").gsub(/_/,'').to_i
seed = (ARGV[0] || Time.now).to_i
# $stderr.puts "seed is #{seed}"
srand(seed)
time = Time.now.to_f
users = %w[Ace Beer Charlie Don Edward Freddie George Harry Ink Johnnie King London Monkey Nuts Orange Pip Queen Robert Sugar Toc Uncle Vic William Xray Yorker Zebra]
num_times.times do |user|
time += 1 if rand > 0.7
puts [
(time * 1000 + rand(1000)).to_i,
time.to_i,
users[rand(users.length-1)],
].join(",")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment