Skip to content

Instantly share code, notes, and snippets.

Josh Graham delitescere

Block or report user

Report or block delitescere

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am delitescere on github.
  • I am delitescere (https://keybase.io/delitescere) on keybase.
  • I have a public key whose fingerprint is 8D3B A04F B589 A408 6F54 CF24 29CA E20F 8F35 51C6

To claim this, I am signing this object:

View gist:2594472
lazy val defaultBrowserVersion = Play.configuration.getString("snapshot.browserVersion")
.map(extractVersion _)
.getOrElse(BrowserVersion.FIREFOX_3_6) // Firefox 3.6 makes a good default because it works on all OSes
// Do you really need to throw an exception? Why not log it as an error, and return None so you end up with the default above?
def extractVersion(browserString: String): Option[BrowserVersion] = {
allCatch opt {
Some(classOf[BrowserVersion].getField(browserString).get(null).asInstanceOf[BrowserVersion])
}
View gist:2594342
aMap.get("a key that might not exist")
.map(expressionUsingTheValue(_))
.getOrElse(anotherExpression)
@delitescere
delitescere / gist:2155822
Created Mar 22, 2012
How to get the HTTP Request to the authenticate method?
View gist:2155822
tuple(...
).verifying("Invalid username or password", _ match {
case (Some(u), Some(p), _) => authenticate(u, p)
...
})
You can’t perform that action at this time.