Created
July 20, 2014 04:32
-
-
Save betacar/ba018d817d413b703f3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generates a character range collection from a to z | |
JSON.stringify(Array.apply(null, {length: 26}).map(function (x,i) { return {userId: String.fromCharCode(97 + i) }})); | |
// generates a collection of from and to | |
JSON.stringify(Array.apply(null, {length: 26}).map(function (x,i) { from = String.fromCharCode(97 + (Math.random() * (26 - i) + i)); to = String.fromCharCode(97 + (Math.random() * (26 - 0) + 0)); return {from: from, to:to} })); | |
// generates a collection of user and music | |
JSON.stringify(Array.apply(null, {length: 100}).map(function (x,i) { return {musicId: "m" + Math.floor(Math.random() * (10 - i) + i), userId: String.fromCharCode(97 + (Math.random() * (26 - 0) + 0))} })); | |
// generates a random JSON collection with a musicId and generes attributes | |
JSON.stringify(Array.apply(null, {length: 100}).map(function (x,i) { return {musicId: "m" + (i + 1), generes: (Math.random() / +new Date()).toString(24).replace(/[^a-z]+/g, '') + "," + (Math.random() / +new Date()).toString(24).replace(/[^a-z]+/g, '')} })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment