Skip to content

Instantly share code, notes, and snippets.

case class ViewRow[K, V, D](id: String, key: K, value: V, doc: Option[D])
def viewRowFormat[K : Format, V : Format, D : Format] = (
(__ \ 'id).format[String] ~
(__ \ 'key).format[K] ~
(__ \ 'value).format[V] ~
(__ \ 'doc).formatNullable[D]
).apply(ViewRow.apply, unlift(ViewRow.unapply[K, V, D]))
@arturaz
arturaz / json.scala
Last active December 14, 2015 00:38
object Model {
trait Mutation[A]{
val doc: A
}
case class Upsert[A](doc: A) extends Mutation[A]
case class Delete[A](doc: A) extends Mutation[A]
// Json format
package com.wierd
import org.openqa.selenium
import org.scalatest.selenium.Firefox
object FFTest extends Firefox {
def main(args: Array[String]): Unit = {
webDriver.manage.window.setSize(new selenium.Dimension(1200, 800))
require 'java'
require 'libssrckdtree-j-1.0.2.jar'
GenericPoint = Java::com.savarese.spatial.GenericPoint
KDTree = Java::com.savarese.spatial.KDTree
def generate_points(tree, size)
size.times do
x = rand(100)
y = rand(100)