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
(function($) { | |
var events = ['success', 'error', 'complete']; | |
function getTrigger() { | |
return $(document.activeElement).is('input:submit,button:submit') ? document.activeElement : null; | |
} | |
function capitaliseFirstLetter(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
(function($, undefined){ | |
function copyEvents(source, target) { | |
var evs = $._data(source[0], 'events'); | |
for (var ev in evs) { | |
for (var i = 0; i < evs[ev].length; i++) | |
$.fn[ev].apply(target, [evs[ev][i].handler]); | |
} | |
} |
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
(function($){ | |
var opts_key = '_sorter_opts_'; | |
var defaults = { | |
desc: false, | |
duration: 300 | |
}; | |
function orderNumbers(a,b){ |
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
public static class DbSetExtensions | |
{ | |
public static void AddIfNotExists<TEntity, TProperty>(this IDbSet<TEntity> dbSet, | |
Expression<Func<TEntity, TProperty>> selector, | |
params TEntity[] toAdd) where TEntity : class | |
{ | |
var compiled = selector.Compile(); | |
foreach (var entity in toAdd) | |
{ |
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") |
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
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
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
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
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} | |
OlderNewer