Skip to content

Instantly share code, notes, and snippets.

@fbencosme
Last active August 29, 2015 14:19
Show Gist options
  • Save fbencosme/b4fb545f234bfcb771ce to your computer and use it in GitHub Desktop.
Save fbencosme/b4fb545f234bfcb771ce to your computer and use it in GitHub Desktop.
something I saw in devDom
/**
var image = images.memeloperCompilingImage;
for(var day = 0; day < days.length; day++) {
if(day === 5 && !isMemeloperTodayPublushed(image)) {
// Public this memeloper every friday.
memeloperTopics.push(image);
}
}
**/
## Versus
images.find(isCompiling)
.filter(img -> isFriday! && !wasPublished(img))
.map(publish)
isCompiling = (img) -> # code goes here
isFriday = -> # code goes here
wasPublished = (img) -> # code goes here
publish = (img) -> # code goes here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment