This is an attempt to document the interpretation of various date
fields in the ttninjs spec. Some fields are internal to TT and not
visible in metadata delivered to customers. Internal fields are
prefixed _
.
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 { Semaphore } from 'await-semaphore' | |
import { EventEmitter } from 'events' | |
import Redis from 'ioredis' | |
import StrictEventEmitter from 'strict-event-emitter-types' | |
interface Events<T> { | |
change: (data: T) => void, | |
delete: void | |
} |
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 | |
input=$1 | |
perl -i -pe 's/^( +)(?!expect)([^ ]*q?)(\.should)/$1expect($2)$3/ ' $input | |
perl -i -pe 's/\.(should|to)\.(not\.)?(eql|equal)/.$2toEqual/' $input | |
perl -i -pe 's/\.(should|to)\.(not\.)?be.instance[oO]f/.$2toBeInstanceOf/' $input |
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 ElasticSearch = require('elasticsearch') | |
function scrollingSearch (es, index, type, size, scroll, body, stagger = 0) { | |
return { | |
[Symbol.asyncIterator]: async function* next () { | |
let count = 0 | |
let r = await es.search({ index, type, size, scroll, body }) | |
while (count < r.hits.total) { | |
for (let hit of r.hits.hits) { | |
await new Promise((resolve, reject) => setTimeout(resolve, stagger)) |
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
# mutators | |
get = -> | |
set = (newVal) -> (val) -> newVal | |
add = (inc) -> (val) -> val + inc | |
sub = (inc) -> (val) -> val - inc | |
# guards | |
increasing = (oldVal, newVal) -> throw Error "#{newVal} <= #{oldVal}" unless newVal > oldVal | |
decreasing = (oldVal, newVal) -> throw Error "#{newVal} >= #{oldVal}" unless newVal < oldVal |
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 app.ingester.event; | |
import java.util.Deque; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentLinkedDeque; | |
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.ThreadPoolExecutor; |
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
(ns zmq-test.core | |
(:import [java.io InputStream]) | |
(:use [org.zeromq.clojure])) | |
(def *ctx* (make-context 0)) | |
(defn serialize [form] | |
(.getBytes (with-out-str (pr form)))) | |
(defn deserialize [bytes] |
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 | |
# Please make sure to configure ~/.clojure.conf or /etc/clojure.conf | |
# sample configuration can be found at clojure.conf.sample | |
# | |
# Note, running this script will: | |
# - Run ~/.clojurerc on boot up (if exists) | |
# - Add all .jar files within clj_ext (~/.clojure on default) | |
# to the classpath | |
# |