Skip to content

Instantly share code, notes, and snippets.

View kduraiswami's full-sized avatar
Make computers do stuff

Kailash kduraiswami

Make computers do stuff
  • San Francisco, CA
View GitHub Profile
function getFile(link, selected) {
var xhr = new XMLHttpRequest();
xhr.open('POST', link, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.responseType = 'arraybuffer';
xhr.onload = function () {
if (this.status === 200) {
formatDownload(this);
}
};
people = ['John', 'Amelia', 'Steph']
units = (1..10).to_a
record = []
# this is making our data
500.times do
record << { "#{people.sample}" => "#{units.sample}".to_i }
end
=begin