Skip to content

Instantly share code, notes, and snippets.

View kimmowikman's full-sized avatar

Kimmo Wikman kimmowikman

  • Luoto Company Oy
View GitHub Profile
@manute
manute / pluckGroovy.groovy
Last active April 29, 2016 10:40
Pluck Underscore.js function added to List Groovy metaClass
/*
One argument:
-propertyName
*/
def pluck = { propertyName ->
// Collect results filter coincidence by propertyName
delegate.collect { element ->
element."$propertyName"
@cmmartin
cmmartin / moment-filter.js
Last active July 31, 2019 09:01
A generic Moment.js date filter for Angular.js
// REQUIRES:
// moment.js - http://momentjs.com/
// USAGE:
// {{ someDate | moment: [any moment function] : [param1] : [param2] : [param n]
// EXAMPLES:
// {{ someDate | moment: 'format': 'MMM DD, YYYY' }}
// {{ someDate | moment: 'fromNow' }}