Skip to content

Instantly share code, notes, and snippets.

@muller
muller / n.sh
Last active August 29, 2015 14:21
standalone jre
#!/bin/bash
B="b14"
case `uname` in
Linux) OS="linux";;
CYGWIN_NT-*)
B="b15"
OS="windows"
;;
import java.util.BitSet;
import java.util.HashMap;
public class BooDecisions {
public static void main(String[] args) {
System.out.println(getType(true, false, false));
System.out.println(getType(false, true, false));
System.out.println(getType(false, true, true));
@muller
muller / .protohub
Last active December 11, 2015 13:00
maven:
groupId: com.example.tutorial
artifactId: address-book-protos
version: 0.0.1
from subprocess import call
PATH_TO_EXECUTABLE = "/path/to/executable"
def execute():
call([PATH_TO_EXECUTABLE])
@muller
muller / README.md
Last active September 9, 2016 15:13
values vs external interaction

Values vs External interactions

If I was to define the dependency arrow in UML 3.0 I would draw it in red with a pitchfork. It is evil.

External dependencies like databases or webservices will slow down your team. The development environment will get complex with installations, configurations and debugging.

Mocking isn't the only answer. Working with values only, allow you to implement a slice of your application in isolation.

Dependencies and rules

package consumer
import akka.actor._
import akka.kafka.ConsumerMessage._
import akka.kafka._
import akka.kafka.scaladsl._
import akka.stream._
import akka.stream.scaladsl._
import akka.testkit._
import net.manub.embeddedkafka._
import java.security.cert.X509Certificate
import javax.net.ssl.{KeyManager, SSLContext, X509TrustManager}
import akka.http.scaladsl.ConnectionContext
object NoSSL {
def apply() = {
object NoCheckX509TrustManager extends X509TrustManager {
override def checkClientTrusted(chain: Array[X509Certificate], authType: String) = ()
class CustomStage extends GraphStage[FlowShape[ByteString, ByteString]] {
val in = Inlet[ByteString]("CustomStage.in")
val out = Outlet[ByteString]("CustomStage.out")
override val shape = FlowShape.of(in, out)
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) with InHandler with OutHandler {
setHandlers(in, out, this)
, {
label: "Nakdi unconsumed events",
graphStyle: "stacked",
plots: [
{
facet: "unconsumed_events_0",
filter: "$serverHost='cats-nua' $logfile='/var/log/scalyr-agent-2/containers/influx.log'",
label: "0"
}, {
facet: "unconsumed_events_1",
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_binary")
scala_library(
name = "sjsir",
srcs = ["Test.scala"],
deps = ["@scalajs//:library"],
data = ["@scalajs//:compiler"],
scalacopts = ["-Xplugin:external/scalajs/lib/scalajs-compiler_2.11.11-0.6.19.jar"],
#scalacopts = ["-Xplugin:$(location @scalajs//:compiler)"], ??? location doesn't seems to be working
)