This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object HttpsFilter extends Filter { | |
| def isHttpsRequest(request : RequestHeader) = | |
| Play.isDev || request.headers.get("x-forwarded-proto").exists(_.contains("https")) | |
| override def apply(next: (RequestHeader) => Future[SimpleResult])(request: RequestHeader): Future[SimpleResult] = { | |
| if (isHttpsRequest(request)) | |
| next(request) | |
| else | |
| Future.successful(Results.Redirect("https://"+ request.host + request.uri, request.queryString)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #################################### | |
| # BASIC REQUIREMENTS | |
| # http://graphite.wikidot.com/installation | |
| # http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
| # Last tested & updated 10/13/2011 | |
| #################################### | |
| sudo apt-get update | |
| #################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Vect | |
| import scala.language.higherKinds | |
| sealed trait Nat | |
| sealed trait Z extends Nat | |
| sealed trait S[N <: Nat] extends Nat | |
| trait Exists[A, +B[_ <: A]] { | |
| type fst <: A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VerEx | |
| { | |
| public static function main() | |
| { | |
| var test = new VerEx() | |
| .startOfLine() | |
| .then("http") | |
| .maybe("s") | |
| .then("://") | |
| .maybe("www.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def terrainFunction(levelVector: Vector[Vector[Char]]): Pos => Boolean = | |
| { case Pos(x,y) => | |
| try {levelVector(y)(x) != '-'} catch { case (e : IndexOutOfBoundsException) => false} | |
| } | |
| def findChar(c: Char, levelVector: Vector[Vector[Char]]): Pos = { | |
| val y = levelVector.indexWhere(_.contains(c)) | |
| val x = levelVector(y).indexOf(c) | |
| Pos(x, y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class Unfoldable[A](a : A){ | |
| def unfold[B, This, That](f: A => Option[(B, A)])(implicit cb: CanBuildFrom[This, B, That]): That = { | |
| val builder = cb() | |
| @tailrec def unfolding(a: A) : That = { | |
| f(a) match { | |
| case Some((e, next)) => | |
| builder += e | |
| unfolding(next) | |
| case None => | |
| builder.result() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Fake example showing the syntax | |
| NodeM.dO({ | |
| coll <= db.collection("avatars", _); | |
| avatars <= coll.all("", _); | |
| ret(avatars.length); | |
| })(function (err, res) etc.. ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A LessCSS version of the 960 Grid System | |
| * | |
| * http://lesscss.org/ | |
| * http://960.gs/ | |
| */ | |
| /********************************************************************* | |
| * Settings * | |
| *********************************************************************/ |
NewerOlder