Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Last active November 8, 2016 12:33
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 lopezjurip/597e581c219729ead9b9b22fb75c7795 to your computer and use it in GitHub Desktop.
Save lopezjurip/597e581c219729ead9b9b22fb75c7795 to your computer and use it in GitHub Desktop.
'use strict';
const _ = require('lodash');
const moment = require('moment');
const now = moment().hour(11).minute(30).second(0);
function group(number, name) {
return { number, name };
}
const clearance = 2; // minutes
const duration = 10 + clearance; // minutes
const groups = [
group(1, 'Framework, librerías y patrones'),
group(2, 'Archivos y conceptos'),
group(3, 'Principios fundamentales'),
group(4, 'Patrones de la programación funcional'),
group(5, 'Anti-patrones'),
group(6, 'Refactoring'),
group(7, 'Degradación del código'),
];
const shuffled = _.shuffle(groups).map((g, index) => _.merge(g, {
startAt: now.clone().add(index * duration, 'minutes').format('HH:mm'),
finishAt: now.clone().add((index + 1) * duration, 'minutes').format('HH:mm'),
}));
console.log(JSON.stringify(shuffled, null, 4));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment