Skip to content

Instantly share code, notes, and snippets.

Dave Dixon sparkofreason

Block or report user

Report or block sparkofreason

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sparkofreason / gist:efaf545b1a697af9a5c2cf3dee12680c
Created Sep 10, 2018
Exception thrown importing Clojure gen-class impl of Kafka SourceConnector
View gist:efaf545b1a697af9a5c2cf3dee12680c
#error{:cause "Implementing class",
:via [{:type clojure.lang.Compiler$CompilerException,
:message "java.lang.IncompatibleClassChangeError: Implementing class, compiling:(C:/Users/dave/Projects/Compute/metrics-kafka-connector/test/compute/metrics_kafka_connector_test.clj:1:1)",
:at [clojure.lang.Compiler load "" 7526]}
{:type java.lang.IncompatibleClassChangeError,
:message "Implementing class",
:at [java.lang.ClassLoader defineClass1 "" -2]}],
:trace [[java.lang.ClassLoader defineClass1 "" -2]
[java.lang.ClassLoader defineClass "" 763]
[ defineClass "" 142]
View contour.json
"legends": [
"fill": "color",
"type": "gradient"
"config": {
"range": {
"heatmap": {
View maali-truth-maintenance.clj
(ns provisdom.examples.truth-maintenance
(:require [clojure.spec.alpha :as s]
[provisdom.maali.rules :refer [defrules defqueries defsession def-derive] :as rules]
[clara.rules.accumulators :as acc]
[clojure.pprint :refer [pprint]]))
;;; Attribute specs
(s/def ::location string?)
(s/def ::temperature number?)
(s/def ::high ::temperature)
sparkofreason / lens-cursor-inconsistency
Last active Aug 29, 2015
Inconsistencies in freactive lens-cursor and cursor behavior
View lens-cursor-inconsistency
(ns freactive-sandbox.rx-test
(:require-macros [freactive.macros :refer [rx debug-rx]])
(:require [freactive.core :refer [atom cursor lens-cursor]]
[freactive.dom :as dom]))
(def state (atom {:a 1 :b {:c 2 :d 3}}))
(def lc
(lens-cursor state :b))
sparkofreason / gss-polymer.html
Created Jun 9, 2015
Exception when using GSS with Polymer elements
View gss-polymer.html
<!DOCTYPE html>
<link rel="import" href="/paper-slider/paper-slider.html">
<style type="text/gss">
#d1 {
View paper-button.html
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="/paper-button/paper-button.html">
sparkofreason / rx-test.cljs
Last active Aug 29, 2015
rx-expression with child cursor does not update correctly
View rx-test.cljs
(ns freactive-sandbox.rx-test
(:require-macros [freactive.macros :refer [rx debug-rx]])
(:require [freactive.core :refer [atom cursor]]
[freactive.dom :as dom]))
(def state (atom {:a 1 :b {:c 2 :d 3}}))
(def b (cursor state :b))
(def d (cursor state [:b :d]))
sparkofreason / freactive-sandbox.cljs
Created Apr 21, 2015
add-watch on freactive rx expression not working?
View freactive-sandbox.cljs
(ns freactive-sandbox.core-test
(:require-macros [freactive.macros :refer [rx]])
(:require [freactive.core :refer [atom cursor]]))
(def x (atom {:a 1 :b {:c 2 :d 3}}))
(def b (cursor x
(fn [x] (:b x))
sparkofreason / util.cljx
Last active Jan 20, 2016
Utility functions for bridging Datomic/Datascript
View util.cljx
(ns allgress.datascript.util
(:require [clojure.walk :refer [postwalk]]))
;;; Datomic pull API will return :db/idents as references, like {:my-enum-att {:db/ident :enum-value}}.
;;; This function replaces with the Datascript equivalent {:my-enum-att :enum-value}. Only works
;;; for true "enums", whose only attribute in the entity map is :db/ident.
defn replace-enum-refs [entity-map]
(fn [arg]
(if (and (coll? arg) (map? (second arg)) (= 1 (count (second arg))) (contains? (second arg) :db/ident))
You can’t perform that action at this time.