Skip to content

Instantly share code, notes, and snippets.

@elbowich
elbowich / Main.scala
Created March 14, 2012 16:15
basic scalaquery project
import org.scalaquery.ql.extended.{ExtendedTable => Table}
case class Writer(id: Option[Long] = None, firstName: String, lastName: Option[String] = None)
object Writers extends Table[Writer]("Writer") {
def id = column[Long]("id", O PrimaryKey, O AutoInc)
def firstName = column[String]("firstName")
def lastName = column[Option[String]]("lastName")
def * = id.? ~ firstName ~ lastName <>(Writer.apply _, Writer.unapply _)
}
@elbowich
elbowich / gist:2008342
Created March 9, 2012 19:57
spray gateway
object Gateway {
import cc.spray.Directives._
import cc.spray.directives.Remaining
import cc.spray.client.HttpConduit
val conduit = new HttpConduit("localhost", 8080) // this will connect to the back-end
val route =
path("test-service" / Remaining) {
path => ctx => val headers = ctx.request.headers.filter(_.name != "Host")