Skip to content

Instantly share code, notes, and snippets.

@rbnpercy
Created November 11, 2019 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbnpercy/fe8b21a3809541ec1de71e1b807d4b76 to your computer and use it in GitHub Desktop.
Save rbnpercy/fe8b21a3809541ec1de71e1b807d4b76 to your computer and use it in GitHub Desktop.
require 'json'
x = []
1000000.times do
h = {
'x' => rand,
'y' => rand,
'z' => rand,
'name' => ('a'..'z').to_a.shuffle[0..5].join + ' ' + rand(10000).to_s,
'opts' => {'1' => [1, true]},
}
x << h
end
File.open("1.json", 'w') { |f| f.write JSON.pretty_generate('coordinates' => x, 'info' => "some info") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment