Skip to content

Instantly share code, notes, and snippets.

View George1's full-sized avatar

Yuri Sakhno George1

View GitHub Profile
@George1
George1 / gist:3793925
Created September 27, 2012 13:15 — forked from michalbcz/gist:2757630
groovy - when you're missing collectWithIndex method...
Collection.metaClass.collectWithIndex = { yield ->
def collected = []
delegate.eachWithIndex { listItem, index ->
collected << yield(listItem, index)
}
return collected
}
/*