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
const deepAssign = (target, ...sources) => | |
sources.reduce((total, src) => | |
Object.keys(src).reduce((agg, n) => | |
Object.assign({}, agg, { | |
[n]: ( | |
typeof src[n] === "object" ? | |
deepAssign(target[n] || {}, src[n]) : | |
src[n] | |
) | |
}), |
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 com.recursion | |
import com.lightbend.kafka.scala.streams.StreamsBuilderS | |
import org.apache.kafka.streams.kstream.Materialized | |
object Streams { | |
def build() = { | |
val sb = new StreamsBuilderS() | |
sb.table[String, String]("topic").filter((k,v) => v.length > 0, Materialized.as("STACKOVERFLOW")) | |
sb |
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 SharedStreamsCfg._ | |
object SharedStreamsCfg { | |
abstract class HasConfig | |
case object Y extends HasConfig | |
case object N extends HasConfig | |
type Loaded = Y.type | |
type NotLoaded = N.type | |
def apply()= new SharedStreamsCfg[NotLoaded, NotLoaded, NotLoaded] ("", 0,0) |
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 com.trizzle | |
import java.util.UUID | |
import shapeless.{::, Generic, HList, HNil, Lazy} | |
trait DefaultFor[T] { | |
val default: T | |
} |
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 org.trizzle.kafka | |
import java.io.{ByteArrayOutputStream, DataOutputStream} | |
import java.util | |
import com.sksamuel.avro4s._ | |
import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient | |
import org.apache.kafka.common.serialization.{Deserializer, Serde, Serializer} | |
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
var boolExprMap = { | |
$and: function(a,b){ return a && b} , | |
$or: function(a,b){ return a || b; } | |
} | |
var TreeNode = function(op,def){ | |
op = (op || '$and').toLowerCase(); | |
this.op = boolExprMap[op]; | |
def = def || (op === '$and') | |
this.fns = [new LeafNode(function(){return def;})]; |
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 org.apache.avro.io.BinaryDecoder; | |
import org.apache.avro.io.DatumReader; | |
import org.apache.avro.io.DecoderFactory; | |
import org.apache.avro.reflect.ReflectDatumReader; | |
import org.apache.avro.specific.SpecificDatumReader; | |
import org.apache.flink.api.common.typeinfo.TypeInformation; | |
import org.apache.flink.api.java.typeutils.TypeExtractor; | |
public class AvroDeserializationSchema<T> implements DeserializationSchema<T> { | |
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 com.trizzle.etcd | |
import net.nikore.etcd.EtcdClient | |
import net.nikore.etcd.EtcdJsonProtocol.EtcdResponse | |
import spray.json._ | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.reflect.Manifest | |
import scala.util.{Failure, Try, Success} |
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
/* | |
* ng-currency | |
* http://alaguirre.com/ | |
* Version: 0.7.14 - 2015-04-14 | |
* License: MIT | |
*/ | |
angular.module('ng-currency', []) | |
.directive('ngCurrency', ['$filter', '$locale', function ($filter, $locale) { | |
return { |
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 Test | |
{ | |
static void Main() | |
{ | |
IStartClause<Person> startClause = null; | |
startClause | |
.Start(ctx => ctx.AtAnyNode(p => p)) | |
.Match(ctx => ctx.Node(p => p).Relates("has_job").To(p => p.Job)) | |
.Where(p => p.Name == "Mark" && p.Job.Name == "MGND") |