Skip to content

Instantly share code, notes, and snippets.

View croucha's full-sized avatar
😎

Andre croucha

😎
  • [the cloud]
View GitHub Profile
@croucha
croucha / underscore.move.js
Created November 23, 2016 02:18 — forked from kjantzer/underscore.move.js
Underscore.js Mixin: Move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
/*
_.move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
*/
_.mixin({
move: function (array, fromIndex, toIndex) {
array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );
return array;
}
package net.kristopherjohnson.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
/**
* Methods for dealing with timestamps
@croucha
croucha / CollectionsPredicateFilterSample.java
Last active August 29, 2015 14:07 — forked from jackrabb1t/CollectionsPredicateFilterSample.java
Using predicates in apache common collections
import static java.lang.System.out;
import static java.util.Arrays.asList;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
public class ListTests {
public static void main( String[] args ) {
List<String> names = asList( "Ted", "Fred", "Jed", "Ned" );