Skip to content

Instantly share code, notes, and snippets.

<p simple-directive="some configuration"></p>
# Based on: https://gist.github.com/aslakknutsen/2422117
GIT_REPO=$1
START_TAG=$2
MVN_COMMAND="mvn clean install -fn"
SONAR_COMMAND="mvn org.codehaus.sonar:sonar-maven3-plugin:3.7:sonar"
if [ -z "$GIT_REPO" ]; then
echo "Missing program argument: repository"
echo "Usage: ./sonar_history.sh git_repository_path [start-tag]"
package Boot
import akka.actor.{Cancellable, Actor, ActorSystem, Props}
import akka.stream.{OverflowStrategy, ActorFlowMaterializer}
import akka.stream.actor.ActorSubscriberMessage.{OnComplete, OnNext}
import akka.stream.actor.{ActorSubscriber, OneByOneRequestStrategy, RequestStrategy}
import akka.stream.scaladsl._
import org.akkamon.core.exporters.StatsdExporter
import org.akkamon.core.instruments.{CounterTrait, LoggingTrait, TimingTrait}
name := "akka-http-websockets"
version := "1.0"
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream-experimental" % "1.0-RC2",
"com.typesafe.akka" %% "akka-http-core-experimental" % "1.0-RC2",
"com.typesafe.play" %% "play-json" % "2.3.4"
import java.net.{SocketOptions, Inet4Address, InetAddress, Socket}
import java.util.concurrent.TimeoutException
import akka.actor.{ActorRef, Props, ActorSystem}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.ws._
import akka.io.Inet
import akka.routing.BroadcastGroup
import java.io.File
import akka.actor._
import akka.routing.{RemoveRoutee, ActorRefRoutee, AddRoutee}
import akka.stream.actor.ActorPublisher
import play.api.libs.json.Json
import scala.annotation.tailrec
import scala.concurrent.duration._
/**
import java.io.File
import akka.actor._
import akka.routing.{Routee, RemoveRoutee, ActorRefRoutee, AddRoutee}
import akka.stream.actor.ActorPublisher
import org.akkamon.core.ActorStack
import org.akkamon.core.instruments.CounterTrait
import play.api.libs.json.Json
import scala.annotation.tailrec
import scala.concurrent.duration._
@josdirksen
josdirksen / Validations.scala
Created August 7, 2015 17:03
Scalaz, Readers and Validations
import scalaz._
import Scalaz._
/**
* Simple example showing how to use the reader pattern together with
* the Scalaz provided ValidationNel to apply validations in a functional
* easily extensible manner.
*/
object ValidationSample extends App {
object ReadSample extends App {
/**
* The readable trait defines how objects can be converted from a string
* representation to the objects instance. For most of the standard types
* we can simply use the toType function of String.
*/
trait Readable[T] {
def read(x: String): T
}
--
CREATE OR REPLACE FUNCTION notify_event() RETURNS TRIGGER AS $$ DECLARE
data json;
notification json;
BEGIN
-- Convert the old or new row to JSON, based on the kind of action.
-- Action = DELETE? -> OLD row
-- Action = INSERT or UPDATE? -> NEW row