Skip to content

Instantly share code, notes, and snippets.

@eirikm
eirikm / Spike.java
Created February 12, 2013 09:46
Guava spike
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import org.junit.Test;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import static org.fest.assertions.Assertions.assertThat;
/**
* Part Zero : 10:15 Saturday Night
*
* (In which we will see how to let the type system help you handle failure)...
*
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0)
*/
import scalaz._
import Scalaz._
@eirikm
eirikm / DateExtractorsTest
Created October 30, 2013 08:07
Bonusoppgave for extractors
package scalakurs.patternmatching
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
class DateExtractorsTest extends FunSpec with ShouldMatchers {
describe("IsoDate unapply") {
it("\"2013-10-29\" should return Some((2013, 10, 29))") {
"2013-10-29" match {

Keybase proof

I hereby claim:

  • I am eirikm on github.
  • I am eirikm (https://keybase.io/eirikm) on keybase.
  • I have a public key ASDqTdysRBnGBHrpY0QaBBR-MhXBU0Hq1P7j-eWNWRa4tgo

To claim this, I am signing this object: