Add the relevant webjars to your build file:
libraryDependencies += "org.webjars.bower" % "angular" % "1.3.15"
Add the resources to your server definition:
unfiltered.netty.Server
Add the relevant webjars to your build file:
libraryDependencies += "org.webjars.bower" % "angular" % "1.3.15"
Add the resources to your server definition:
unfiltered.netty.Server
object PullApplicationActorLess extends App { | |
var context: ZMQ.Context = null | |
var pullSocket: ZMQ.Socket = null | |
context = ZMQ.context(5) | |
pullSocket = context.socket(ZMQ.PULL) | |
pullSocket.connect("tcp://127.0.0.1:5555") | |
println("Starting consumer ...") |
package models | |
import com.typesafe.config.ConfigFactory | |
import reactivemongo.api.{DefaultDB, DB, MongoDriver} | |
import akka.event.slf4j.Logger | |
import reactivemongo.api.collections.default.BSONCollection | |
import scala.util.Try | |
object MongoDb { | |
private val logger = Logger("MongoDB") |
package my.test.app | |
import akka.actor.{ActorSystem,Props} | |
import akka.io.IO | |
import spray.can.Http | |
object Boot extends App { | |
implicit val system = ActorSystem("Tester") | |
val service = system.actorOf(Props[TesterActor], "tester-service") | |
IO(Http) ! Http.Bind(service, interface = "0.0.0.0", port = 8080) |
#!/usr/bin/env bash | |
# Written by William Ting for the following blog post: | |
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/ | |
rcfile="${HOME}/.bashrc" | |
version="2.7.5" | |
setuptools_version="2.7" | |
tmp_dir="${HOME}/tmp-${RANDOM}" | |
if [[ ${#} == 0 ]]; then |
# Description: | |
# Post gitlab related events using gitlab hooks and hipchat API | |
# | |
# Dependencies: | |
# "url" : "" | |
# "querystring" : "" | |
# | |
# Configuration: | |
# HIPCHAT_TOKEN | |
# GITLAB_ROOT |
package database; | |
import com.esotericsoftware.reflectasm.ConstructorAccess; | |
import com.esotericsoftware.reflectasm.FieldAccess; | |
import org.bson.*; | |
import org.bson.codecs.Codec; | |
import org.bson.codecs.DecoderContext; | |
import org.bson.codecs.EncoderContext; | |
import java.lang.reflect.Array; |
/* | |
* The premise of this is simple; it allows you to chain subroutines without using a block | |
* The idea comes from Haskell's Monads, where by language design you can't normally | |
* predict the order of statement execution due to the language being lazy, | |
* so instead an operator was added that allowed you to call statements sequencially | |
* | |
* Rather than writing something like this: | |
* def printStuff(): Unit = { | |
* println("blah") | |
* println("bloo") |
//http://docs.scala-lang.org/overviews/core/string-interpolation.html | |
implicit class MyQuote(ctx:StringContext){ | |
def x(args:String*):String=ctx.parts.zip(args).map{case (p,a)=>s"$p$a"}.mkString("") | |
} | |
val string="STRINGY" | |
val string2="STRINGY2" | |
println(x"Part1 $string Part2 $string2 Part3 $string") |
def whenReady[A](result:Future[A], timeout:Duration = 1 second)(expectation: A => Unit) = { | |
expectation(Await.result(result, timeout)) | |
} | |
def tryWhenReady[A](result:Future[Try[A]], timeout:Duration = 1 second) | |
(failure:Throwable => Unit) | |
(expectation: A => Unit) = { | |
Await.result(result, timeout) match { | |
case Failure(e) => failure(e) | |
case Success(result:A) => expectation(result) |