Skip to content

Instantly share code, notes, and snippets.

View JohnMurray's full-sized avatar

John Murray JohnMurray

View GitHub Profile
@mariussoutier
mariussoutier / Mail.scala
Created August 23, 2012 12:13
Sending mails fluently in Scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
@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")