Skip to content

Instantly share code, notes, and snippets.


Caleb Macdonald Black CalebMacdonaldBlack

View GitHub Profile
CalebMacdonaldBlack /
Created Nov 22, 2017
Example shell script template/boilerplate
#!/usr/bin/env bash
appname=$(basename -s .git `git config --get remote.origin.url`)
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
grn=$(tput setaf 2) # Green
red=$(tput setaf 1) # Red
bldgrn=${txtbld}$(tput setaf 2) # Bold Green
bldred=${txtbld}$(tput setaf 1) # Bold Red
View sub_watch.cljs
(ns whatever.sub-test
(:require [reagent.core :as r]
[reagent.ratom :as ratom]
[re-frame.core :as rf]))
(def invalidate-form
{:before identity
:after (fn [{{:keys [:db]} :effects :as ctx}]
(assoc-in ctx [:effects :db :test-changed] true))}))
CalebMacdonaldBlack / query_check.clj
Created Apr 11, 2018 — forked from maxweber/query_check.clj
Checks if a Datomic datalog query contains only allowed symbols / functions.
View query_check.clj
(require '[datomic.api :as d]
'[clojure.string :as str])
(defn normalize-query
"Turns a vector formatted Datomic datalog query into a map formatted
(let [pairs (partition-by keyword? query)]
(assert (even? (count pairs)))