This file contains 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 case class SimpleController() extends Controller { | |
def action(implicit request: HttpRequest) = { | |
Ok("Simple string response.") | |
} | |
} |
This file contains 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 com.plasmaconduit.framework | |
import com.plasmaconduit.conveyance.Box | |
import com.plasmaconduit.edge.http._ | |
import com.plasmaconduit.framework._ | |
import com.plasmaconduit.framework.mvc.Controller | |
import com.plasmaconduit.framework.mvc.middlewares.SessionMiddleware | |
import com.plasmaconduit.framework.routes.containers.{HttpGetMethodRoutes, HttpRoutes} | |
import com.plasmaconduit.framework.routes.destinations.HttpPathRoute | |
import com.plasmaconduit.framework.sessions.jwt.JWTSessionHandler |
This file contains 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
resolvers += "Plasma Conduit Repository" at "http://dl.bintray.com/plasmaconduit/releases", | |
libraryDependencies += "com.plasmaconduit" %% "plasmaconduit-framework" % "0.50.0" |
This file contains 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
<?hh // strict | |
namespace traitorous; | |
use traitorous\algebraic\Applicative; | |
use traitorous\algebraic\Functor; | |
use traitorous\algebraic\Monad; | |
use traitorous\algebraic\MonadOps; | |
final class IO<T> implements Functor<T>, Applicative<T>, Monad<T> { |
This file contains 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
import scalaz._ | |
import scalaz.concurrent._ | |
import Future._ | |
object Main { | |
def lamePrint(s: String): Future[Unit] = async { next => | |
println(s) | |
next() | |
} |
This file contains 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 com.blackboxsociety.http | |
import scala.util.parsing.combinator._ | |
sealed trait HttpMethod | |
case object HttpGet extends HttpMethod | |
case object HttpHead extends HttpMethod | |
case object HttpPost extends HttpMethod | |
case object HttpPut extends HttpMethod | |
case object HttpDelete extends HttpMethod |
This file contains 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
<?php | |
$loop = PureLoop::loop(); | |
$ticked = $loop->flatMap(function(PureLoop $loop) { | |
return $loop->nextTick(function(PureLoop $loop) { | |
return StdIO::putStrLn("Hello from tick")->then(IO::of($loop)); | |
}); | |
}); | |
$timed = $ticked->flatMap(function(PureLoop $loop) { |
This file contains 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
var trait = require("../../util/trait"); | |
module.exports = trait("UserServiceInterface", [ | |
"createUser", | |
"createUserFromForm", | |
"getUserByEmail", | |
"authenticateUser", | |
"authenticateUserFromForm", | |
"isUserAdmin" | |
]); |
This file contains 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 com.plasmaconduit.pipelines | |
sealed trait Pipeline[E, A] { | |
def map[B](f: A => A): Pipeline[E, A] = this match { | |
case Continue(n) => Continue(f(n)) | |
case Done(n) => Done(n) | |
case Error(e) => Error(e) | |
} |
This file contains 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
import Network.HTTP | |
import Text.HTML.TagSoup | |
import System | |
import System.Process | |
import Control.Monad | |
import IO | |
hackerNewsRSSFeedURL = "http://news.ycombinator.com/rss" | |
fileURLCache = ".hnCache" |