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 main | |
import ( | |
"fmt" | |
"log" | |
"flag" | |
"github.com/boltdb/bolt" | |
"time" | |
) |
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
from fabric.api import task,runs_once,execute,sudo | |
from fabric.colors import green | |
# Example of how to combine the output from multiple hosts | |
# This is a toy example, just to show you how you can loop and combine the results together | |
@task | |
def get_stats(): |
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.std.list._ | |
import scalaz.syntax.monad._ | |
import scalaz.syntax.monoid._ | |
import scalaz.syntax.traverse.{ToFunctorOps => _, _} | |
class Foo[F[+_] : Monad, A, B](val execute: Foo.Request[A] => F[B], val joins: Foo.Request[A] => B => List[Foo.Request[A]])(implicit J: Foo.Join[A, B]) { | |
def bar: Foo[({type l[+a]=WriterT[F, Log[A, B], a]})#l, A, B] = { | |
type TraceW[FF[+_], +AA] = WriterT[FF, Log[A, B], AA] |
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
override def init(config : javax.servlet.ServletConfig) { | |
// val names = config.getInitParameterNames | |
println("PRINTING CONFIG") | |
println(config.getInitParameter("env")) | |
} |
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
class MyServletSpec extends MutableScalatraSpec { | |
tester.getContext.setInitParameter("env", "prod") | |
addServlet(classOf[MyServlet], "/*") |
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
HTTP Status 500 - | |
type Exception report | |
message | |
description The server encountered an internal error () that prevented it from fulfilling this request. | |
exception |
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
class MyTest extends MutableScalatraSpec { | |
addServlet(classOf[MyServlet], "/*") | |
"calling query should" should { | |
"set the status code" in { | |
get("/query") { | |
println(response.getContent) | |
status mustEqual 200 |
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
class MyTest extends MutableScalatraSpec { | |
addServlet(classOf[MyServlet], "/*") | |
"calling query should" should { | |
"set the status code" in { | |
get("/query") { | |
println(response.getContent) | |
status mustEqual 200 |
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
object Settings { | |
var field1:String = _ | |
var field2:String = _ | |
def load(config:Config) { | |
field1 = config.getString("field1") | |
field2 = config.getString("field2") | |
} | |
} |
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 zmq | |
context = zmq.Context() | |
# Socket to talk to server | |
print "Connecting to server" | |
socket = context.socket(zmq.REQ) | |
socket.connect ("tcp://127.0.0.1:5559") | |
print 'Client started' | |
poll = zmq.Poller() |
NewerOlder