Skip to content

Instantly share code, notes, and snippets.

@ibnuh
Last active March 30, 2020 08:42
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 ibnuh/4d3cba7ef349823673300c1aea72cecb to your computer and use it in GitHub Desktop.
Save ibnuh/4d3cba7ef349823673300c1aea72cecb to your computer and use it in GitHub Desktop.
Sample data script
[
{
'repeat(5, 10)': {
id: '{{guid()}}',
name: '{{firstName()}} {{surname()}}',
position: '{{random("Doctor", "Nurse")}}',
registered: 'Mon - {{moment(this.date(new Date(2014, 0, 1), new Date())).format("ddd")}} {{random(1,12)}}:00 {{random("am", "pm")}} - {{random(1,12)}}:00 {{random("am", "pm")}}',
}
}
]
[
'{{repeat(30)}}',
{
id: '{{guid()}}',
name: '{{firstName()}} {{random("Clinic", "Hospital")}}',
address: '{{integer(100, 999)}} {{street()}}, {{city()}}, {{state()}}, {{integer(100, 10000)}}',
openingHours: function(tags){
return tags.random("24 hours", `${tags.random(1, 12)}:00 ${tags.random("am", "pm")} - ${tags.random(1,12)}:00 ${tags.random("am", "pm")}`)
},
type: '{{random("Cardiac", "Physiotherapy", "Sickness")}}'
}
]
// json-generator.com
[
'{{repeat(5, 7)}}',
{
id: '{{guid()}}',
nric: '{{objectId().slice(-10)}}',
name: '{{firstName()}} {{surname()}}',
queueNo: '{{integer(20, 40)}}',
dateCreated: '{{date(new Date(2014, 0, 1), new Date(), "YYYY-MM-dd hh:mm:ss")}}',
isWaiting: '{{bool()}}'
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment