Skip to content

Instantly share code, notes, and snippets.


Oliver George olivergeorge

  • Tasmania, Australia
View GitHub Profile
View app-fx.cljs
(rf/reg-fx ::navigate (fn [a] (navigation/dispatch (navigation/navigate-action a))))
(rf/reg-fx ::navigate2 (fn [[a b]] (navigation/navigate a b)))
(rf/reg-fx ::back (fn [] (navigation/dispatch (navigation/go-back-action))))
(rf/reg-fx ::reset-stack-by-key (fn [m] (navigation/dispatch (navigation/reset-action m))))
(rf/reg-fx ::pop (fn [n] (navigation/dispatch (navigation/pop-action n))))
(rf/reg-fx ::pop-to-top #(navigation/dispatch (navigation/pop-to-top-action)))
View canidatalogtocte.clj
(ns canidatalogtocte
(:require [ :as jdbc]
[clojure.string :as str]
[clojure.spec.alpha :as s]
[datascript.core :as d]
[clojure.test :refer [is]]))
(s/check-asserts true)
(def sqlite-db
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
olivergeorge /
Last active May 15, 2020
REPL not considering namespace aliases if pre-compiled

Setup is based on clojurescript getting started guide. I've added a require statement to the core ns and using the latest master sha


{:deps {org.clojure/clojurescript {:git/url ""
                                   :sha "ec0fc33030ae1858a29c52f38e81fba4180d492b"}}}


olivergeorge /
Last active May 10, 2020
Some notes on React error boundaries

Based on:

Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.

As of React 16, errors that were not caught by any error boundary will result in unmounting of the whole React component tree.

Reagent gives us access to the error boundary features

  • Returning true from :component-did-catch stops the unmounting behaviour

This was close to useful but the SQL generated has problems with ORDER BY clauses.

The subquery was necessary to avoid GROUP BY problems.

    function = 'dbo.AG_DATES_OVERLAP'
    template = "%(function)s(%(expressions)s)"
View app_test_runner.cljs
(ns app.test-runner
(:require [clojure.test :refer [deftest is run-tests]]))
(deftest is-this-working?
(is (= 1 2)))
(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
(when-not (cljs.test/successful? m)
(throw "Test failed")))
olivergeorge / v1.clj
Created Jan 3, 2020
WIP generating relational db content using clojure.test.check
View v1.clj
(ns v1
(:require [clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[ :as prop]
[clojure.spec.alpha :as s]))
(defn gen-char [n]
(gen/fmap #(apply str %) (gen/vector gen/char-alphanumeric n)))
(defn gen-varchar [n]
View advanced-bundled.js
function XG(n, l, t) {
return Qa(fu([Sc, t])),
KG(l) || BG(n, l, pS) ? Array.isArray(t) || Nu(t) && !Mu(t) ? Tt.h(bu(t), 2) && BG(n, qt(t), $h) ? (Qa(fu([lw, "probably lookup ref", Wa.w(fu([new os(null, 5, ["vs", t, "(type vs)", Yn(t), "(count vs)", bu(t), "(first vs)", qt(t), "(is-attr? db (first vs) :db.unique/identity)", BG(n, qt(t), $h)], null)]))])),
new Ri(null, 1, 5, _i, [t], null)) : (Qa(fu([Lk])),
t) : (Qa(fu([xh, "not a collection at all, so definitely a single value", Wa.w(fu([new os(null, 6, ["vs", t, "(type vs)", Yn(t), "(arrays/array? vs)", Array.isArray(t), "(coll? vs)", Nu(t), "(vector? vs)", Hu(t), "(map? vs)", Mu(t)], null)]))])),
Qa(fu([Yo, "(satisfies? ICollection x)", null != t ? !!(8 & t.A || Rn === || !t.A && Wn(ol, t) : Wn(ol, t)])),
new Ri(null, 1, 5, _i, [t], null)) : (Qa(fu([Fb, "not a multival context", new os(null, 4, ["a", l, "(type a)", Yn(l), "(reverse-ref? a)", KG(l), "(multival? db a)", BG(n, l, pS)], null)])),
View a_trackers.cljs
(ns app.a-trackers
(:require [reagent.core :as r]))
(defonce reg-trackers (atom {}))
(defn reg-tracker
([k signal]
(reg-tracker k signal #(rf/dispatch [k %])))
([k signal effect]
(when-let [{:keys [tracker]} (get @reg-trackers k)]