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 akka.amqp.AMQP._ | |
import akka.amqp._ | |
import akka.actor._ | |
import java.util.concurrent.{TimeUnit, CountDownLatch} | |
import util.Random | |
object LoadBalancingDemo { | |
def main(args: Array[String]) { |
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
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
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 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 ...") |
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 | |
# 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.3" | |
setuptools_version="2.7" | |
tmp_dir="${HOME}/tmp-${RANDOM}" | |
if [[ ${#} == 0 ]]; then |
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
try: | |
import simplejson as json | |
except ImportError: | |
try: | |
import json | |
except ImportError: | |
raise ImportError | |
import datetime | |
from bson.objectid import ObjectId | |
from werkzeug import 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
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) |
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 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") |
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 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) |
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
#!/bin/sh | |
# this hook is in SCM so that it can be shared | |
# to install it, create a symbolic link in the projects .git/hooks folder | |
# | |
# i.e. - from the .git/hooks directory, run | |
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit | |
# | |
# to skip the tests, run with the --no-verify argument | |
# i.e. - $ 'git commit --no-verify' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="author" content="Galenic"> | |
<script src="js/jquery-1.9.1.js"></script> | |
<script src="js/knockout-2.1.0.js"></script> | |
<script src="js/Chart.js"></script> | |
<link rel="stylesheet" href="pure-min.css"> |
OlderNewer