Skip to content

Instantly share code, notes, and snippets.

View twashing's full-sized avatar

Timothy Washington twashing

View GitHub Profile
(require
'[clojure.core.async :refer [chan sliding-buffer <! go-loop onto-chan] :as async]
'[manifold.stream :as stream]
'[prpr.stream.cross :as stream.cross])
(let [tick-list->macd-ch (chan (sliding-buffer 50))
sma-list->macd-ch (chan (sliding-buffer 50))
tick-list->MACD (->> tick-list->macd-ch
stream/->source
(:require [clojure.core.async :refer [chan sliding-buffer <! go-loop pipeline onto-chan] :as async]
[clojure.set :refer [subset?]]
[clojure.tools.logging :as log])
(defn has-all-lists? [averages-map]
(subset? #{:tick-list :sma-list :ema-list} (->> averages-map keys (into #{}))))
(defn join-averages []
(let [state (atom {})]
(fn [rf]
@twashing
twashing / gist:923babf70fe008394243b8da2d6d1ec5
Created April 29, 2017 18:14
simplekafkaonyxcommander kafka logs
kafka_1 | ===> ENV Variables ...
kafka_1 |
kafka_1 | echo "===> ENV Variables ..."
kafka_1 | + echo '===> ENV Variables ...'
kafka_1 | env | sort
kafka_1 | + env
kafka_1 | + sort
kafka_1 | COMPONENT=kafka
kafka_1 | CONFLUENT_DEB_REPO=http://packages.confluent.io
kafka_1 | CONFLUENT_DEB_VERSION=1
@twashing
twashing / gist:659773e5c4e85178c5ce61c3cf6b2372
Created April 29, 2017 18:13
simplekafkaonyxcommander zookeeper logs
zookeeper_1 |
zookeeper_1 | echo "===> ENV Variables ..."
zookeeper_1 | + echo '===> ENV Variables ...'
zookeeper_1 | env | sort
zookeeper_1 | + env
zookeeper_1 | + sort
zookeeper_1 | ===> ENV Variables ...
zookeeper_1 | COMPONENT=zookeeper
zookeeper_1 | CONFLUENT_DEB_REPO=http://packages.confluent.io
zookeeper_1 | CONFLUENT_DEB_VERSION=1
@twashing
twashing / gist:7c1d1ac90b14ecfeb2bdea5d8f6fdec2
Created April 29, 2017 18:11
simplekafkaonyxcommander app logs
app_1 | Retrieving cider/cider-nrepl/0.15.0-SNAPSHOT/cider-nrepl-0.15.0-20170427.182503-13.pom from clojars
app_1 | Retrieving org/clojure/tools.nrepl/0.2.12/tools.nrepl-0.2.12.pom from central
app_1 | Retrieving org/tcrawley/dynapath/0.2.5/dynapath-0.2.5.pom from central
app_1 | Retrieving refactor-nrepl/refactor-nrepl/2.3.0-SNAPSHOT/refactor-nrepl-2.3.0-20170210.162113-13.pom from clojars
app_1 | Retrieving org/clojure/clojure/1.2.0/clojure-1.2.0.pom from central
app_1 | Retrieving cider/cider-nrepl/0.15.0-SNAPSHOT/cider-nrepl-0.15.0-20170427.182503-13.jar from clojars
app_1 | Retrieving refactor-nrepl/refactor-nrepl/2.3.0-SNAPSHOT/refactor-nrepl-2.3.0-20170210.162113-13.jar from clojars
app_1 | Retrieving org/clojure/tools.nrepl/0.2.12/tools.nrepl-0.2.12.jar from central
app_1 | Retrieving org/tcrawley/dynapath/0.2.5/dynapath-0.2.5.jar from central
app_1 | Retrieving org/danielsz/system/0.4.1-SNAPSHOT/system-0.4.1-201
@twashing
twashing / gist:535d293ed3eb47c16b9e00207ff487cd
Created April 29, 2017 18:04
simplekafkaonyxcommander onyx.log
17-04-29 17:59:53 bc7ea6895070 INFO [onyx.static.logging-configuration:34] - Starting Logging Configuration
17-04-29 17:59:53 bc7ea6895070 INFO [onyx.log.zookeeper:114] - Starting ZooKeeper server
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.static.logging-configuration:34] - Starting Logging Configuration
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.messaging.aeron.messaging-group:12] - Starting Aeron Peer Group
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.monitoring.metrics-monitoring:89] - Started Metrics Reporting to JMX.
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.log.zookeeper:114] - Starting ZooKeeper client connection. If Onyx hangs here it may indicate a difficulty connecting to ZooKeeper.
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.log.zookeeper:114] - Starting ZooKeeper client connection. If Onyx hangs here it may indicate a difficulty connecting to ZooKeeper.
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.peer.communicator:32] - Starting Log Writer
17-04-29 17:59:55 bc7ea6895070 INFO [onyx.peer.communicator:65] - S
;; Slightly enhanced version of Alex Osborne's debug-repl (http://gist.github.com/252421)
;; Typing () quits the debug REPL, making it possible to continue without terminating the
;; input stream by typing Ctrl-D.
;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html
(ns debug
[:require clojure.main])
(defmacro local-bindings
@twashing
twashing / debug.clj
Created July 13, 2011 23:06 — forked from ato/debug.clj
Simpler debug-repl that works with unmodified Clojure
;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html
(defmacro local-bindings
"Produces a map of the names of local bindings to their values."
[]
(let [symbols (map key @clojure.lang.Compiler/LOCAL_ENV)]
(zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))
(declare *locals*)
(defn eval-with-locals
@twashing
twashing / debug.clj
Created February 22, 2011 03:08 — forked from GeorgeJahad/debug.clj
;; even more enhanced version with that allows ret val override and better prompt
;; Slightly enhanced version of Alex Osborne's debug-repl (http://gist.github.com/252421)
;; Typing () quits the debug REPL, making it possible to continue without terminating the
;; input stream by typing Ctrl-D.
;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html
(ns clojure.contrib.debug
[:require clojure.main])
@twashing
twashing / browserrepl.clj
Last active August 29, 2015 14:04
Austin Browser Repl Component
(ns bkell.component.browserrepl
(:require [com.stuartsierra.component :as component]
[taoensso.timbre :as timbre]))
;; Creating aa Austin repl-env inside of a component (I call it browserrepl)
(defn create-repl-env [host]
(reset! cemerick.austin.repls/browser-repl-env (cemerick.austin/repl-env :host host)) )
(defrecord BrowserRepl [env]