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
fooapp@srv:~$ cat app/env/PLAY_OPTS | |
export DATABASE_URL="jdbc:postgresql://127.0.0.1/foobar" | |
# We could wire a different configuration file here | |
# or set up a different database on the fly | |
export PLAY_OPTS="-DapplyEvolutions.default=true -DapplyDownEvolutions.default=true -Ddb.default.url="$DATABASE_URL" -Ddb.default.user=fooapp -Ddb.default.password=fooapppw -Ddb.default.driver=org.postgresql.Driver" |
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 backend | |
import akka.actor.{Actor, ActorRef, Cancellable} | |
import scala.concurrent.duration.FiniteDuration | |
import scala.util.control.NoStackTrace | |
private case class SchedulerException(msg: String) extends akka.AkkaException(msg) with NoStackTrace | |
/** |
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
https://docs.google.com/a/typesafe.com/presentation/d/1QBhMeRRq5Gs5UfgaqvZ_3-LaxC-fQviLbPi5O8fA71c/edit?usp=sharing |
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
#!/usr/bin/env bash | |
# | |
# A more capable sbt runner, coincidentally also called sbt. | |
# Author: Paul Phillips <[email protected]> | |
# todo - make this dynamic | |
declare -r sbt_release_version=0.13.5 | |
declare -r sbt_unreleased_version=0.13.5 | |
declare -r buildProps=project/build.properties |
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
> testOnly play.it.http.websocket.AkkaHttpWebSocketSpec | |
[info] AkkaHttpWebSocketSpec | |
[info] | |
[info] Plays WebSockets should | |
[info] allow handling WebSockets using Akka streams | |
[info] + allow consuming messages | |
[info] + allow sending messages | |
[info] + close when the consumer is done | |
[info] + allow rejecting a websocket with a result |
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.example | |
object Hello { | |
def main(args: Array[String]): Unit = { | |
val runtime = Runtime.getRuntime | |
val cwd = System.getProperty("user.dir") | |
val process = runtime.exec(s"$cwd/testscript.sh") // pick something harmless | |
println("Process executed without security manager interference!") | |
} | |
} |
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
// GeneratePolicyFromDeniedPermissions - timestamp: Thu Dec 17 13:24:58 PST 2015 | |
grant codeBase "file:/home/wsargent/work/activator-play-tls-example/target/universal/activator-play-tls-example-1.0.0/lib/activator-play-tls-example.activator-play-tls-example-1.0.0-sans-externalized.jar" { | |
permission java.io.FilePermission "certs/clientca.jks", "read"; | |
permission java.io.FilePermission "certs/example.com.jks", "read"; | |
permission java.io.FilePermission "certs/password", "read"; | |
permission java.util.PropertyPermission "play.ssl.needClientAuth", "read"; | |
}; | |
grant codeBase "file:/home/wsargent/work/activator-play-tls-example/target/universal/activator-play-tls-example-1.0.0/lib/ch.qos.logback.logback-classic-1.1.3.jar" { |
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 play.api.libs.ws.ahc.AhcWSClient | |
import akka.stream.ActorMaterializer | |
import akka.actor.ActorSystem | |
implicit val system = ActorSystem() | |
implicit val materializer = ActorMaterializer() | |
val ws = AhcWSClient() | |
val req = ws.url("http://example.com").get().map{ | |
resp => resp.body |
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
// a Train "at" time produces a TrainFromOps | |
// a TrainFromOps "from" station produces a Train | |
// a TrainInfo "at" time produces a TrainInfoFromOps | |
// a TrainInfoFromOps "from" station produces a TrainInfoAtOps | |
// a TrainInfoAtOps "at" time produces a TrainFromOps | |
// TrainOps(train) | |
// TrainInfoOps(info: TrainInfo) | |
// TrainFromOps(info, scheudle, time) |