Skip to content

Instantly share code, notes, and snippets.

View jeffmay's full-sized avatar

Jeff May jeffmay

View GitHub Profile
@jeffmay
jeffmay / WebModule.scala.diff
Last active December 18, 2015 23:49 — forked from softprops/WebModule.scala.diff
I updated the settings.
import coffeescript.Plugin.{CoffeeKeys, coffeeSettings}
import sbt._
import sbt.Keys._
object WebModule extends BaseModule {
val moduleName = "web"
val moduleVersion = "0.1"
@jeffmay
jeffmay / GithubEventAndSerializers.scala
Created February 26, 2014 21:58
Github Event models and serializers with JsPath
package models.github
import org.joda.time.DateTime
import models.{Entity, EntityId}
import models.common.Email
import play.api.libs.json._
import play.api.libs.functional.syntax._
trait Event[T <: Entity] {
@jeffmay
jeffmay / gist:ad071f9dccfa959504e7
Last active August 29, 2015 14:04
Play Json parser helpers
trait HelperThing {
def badRequestFormatMessage: String = ???
implicit class JsResultOps[T : ClassTag](result: JsResult[T]) {
/**
* Folds either JsError or JsSuccess into a result.
*
* @note the error case is always handled synchronously, if you want to recover from an error
@jeffmay
jeffmay / SecurePrinter.scala
Last active August 29, 2015 14:13
SecurePrinter typeclass
import scala.annotation.implicitNotFound
import scala.language.{higherKinds, implicitConversions}
/**
* A typeclass of securely printable values.
*
* Only primitive values and values that are marked as securely printable by default.
*
* You can extend new types as securely printable by adding an implicit printable to the
* companion object of the class.