Last active
November 8, 2016 12:33
-
-
Save lopezjurip/597e581c219729ead9b9b22fb75c7795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'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