Skip to content

Instantly share code, notes, and snippets.

5ABE92E9BF599143D5C16CD91DEE5068BAB8E81B6D31071DEB0F61ED25ACBB06|1|504310|
39E4D196A8AE36460604E1845D48562EC36A47B0CCAE4E9E2664C03154C49223|0|504311|
FC12CE199A154F4EB954DA7FE2487B33447F840CBAF79C40F3DAB780DBEB9612|0|504317|
80CDBC84FD499FFDA929729217EF0A5DDFEB7E02E4F20018B352D127D7DF8CF1|1|504383|
E6BFA334835928F7742CD329F0915351BFE0CB9E27F33FF63DC25124BD6C4D4E|1|504419|
96C2972EF1E3038426F925312DAD03D27468F665A3194542B70BE030BF56ED6A|1|504434|
DCAE326F4FE7EE87AB09699BF032FA10280E6267F33DCB6AA7CB118C7BD033C0|0|504450|
E7C7483786D3F5003A502DA9012F4982AC21D52BC4F08E06C176217C49B426DF|1|504481|
4E0168ECC08B3BFE66B3421DF861205771F2B9C4CBED210ABFA8C233568BEF59|0|504550|
3A54186274FBE4C4B1D078A1010C79C76EC92FF0570F83B1C6D3287243F6505A|0|504550|
@danielalexiuc
danielalexiuc / MoreCollectors.java
Created December 11, 2015 00:28
Java 8 Stream Collectors that should have been in the JDK from the start!
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collector;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
/**
* Just some stuff that the JDK is missing :rolleyes:
@danielalexiuc
danielalexiuc / README
Created December 2, 2015 02:20 — forked from kalebdf/LICENSE
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
- Added IE support & check (@kalebdf, 8/19/2015)
http://bl.ocks.org/kalebdf/ee7a5e7f44416b2116c0
@danielalexiuc
danielalexiuc / Test for stuff guava is missing.
Created January 18, 2013 00:32
Test for stuff Guava is missing
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Optional.presentInstances;
import static com.google.common.collect.Iterables.concat;
import static com.google.common.collect.Iterables.elementsEqual;
import static com.google.common.collect.Iterables.toArray;
import static com.google.common.collect.Lists.newArrayList;
import static java.math.BigDecimal.ONE;
import static java.math.BigDecimal.ZERO;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertArrayEquals;
@danielalexiuc
danielalexiuc / StaticGzipPlugin.java
Created June 6, 2012 14:54
Here's how to get static resources minified and gzipped. Most addons and plugins I've seen don't handle static resources. Stick this file anywhere in the classpath (I put it in "util" directory) and stick the play.plugins file into your conf directory.
package util;
import com.google.common.io.Files;
import play.Logger;
import play.Play;
import play.PlayPlugin;
import play.libs.MimeTypes;
import play.mvc.Http;
import play.utils.Utils;
import play.vfs.VirtualFile;
@danielalexiuc
danielalexiuc / TestUtils.java
Created April 12, 2012 02:51
Time Bomb - a better alternative to JUnit @ignore
/**
* Use to delay a unit test for a bit to give someone the chance to fix it.
*
* Common usage:
*
* if (TestUtils.timeBomb("TDB: Bob please fix", "20100123")){
* if (true) return;
* }
*/
public static boolean timeBomb(String message, String timerExpiresOnYYYYMMDD) {