Skip to content

Instantly share code, notes, and snippets.

View fwbrasil's full-sized avatar

Flavio Brasil fwbrasil

  • Nubank
  • San Francisco Bay Area, California
View GitHub Profile
@fwbrasil
fwbrasil / transcript
Last active August 29, 2015 14:16 — forked from paulp/transcript
scala> class Bippy(xs: List[Int]) extends improving.TypesafeProxy(xs) { def isEmpty = true }
defined class Bippy
scala> val bippy = new Bippy(1 to 10 toList)
bippy: Bippy = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
scala> bippy.slice(3, 7)
[proxy] $line4.$read.$iw.$iw.bippy.slice(3, 7)
res1: List[Int] = List(4, 5, 6, 7)
object Demo {
// A couple of type classes with type members ...
trait Foo[T] {
type A
}
object Foo {
implicit val fooIS = new Foo[Int] { type A = String }
}
@fwbrasil
fwbrasil / CrudTest.scala
Last active December 17, 2015 00:19 — forked from b0c1/CrudTest.scala
package hu.finesolution.sepia.test.core.controller
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.mock.MockitoSugar
import org.scalatest.{FunSuite, BeforeAndAfter}
import org.scalatra.test.scalatest.ScalatraSuite
import org.scalatra.ScalatraServlet
import net.fwbrasil.smirror._
trait Foo {
@deprecated("foo is a terrible name! what were you thinking?", "0.1")
def foo(i: Int) = i
}
class Bar extends Foo {
}