Skip to content

Instantly share code, notes, and snippets.

Avatar

Caleb Macdonald Black CalebMacdonaldBlack

View GitHub Profile
@CalebMacdonaldBlack
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
one."
[query]
(let [pairs (partition-by keyword? query)]
(assert (even? (count pairs)))
(into
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
(rf/->interceptor
{:before identity
:after (fn [{{:keys [:db]} :effects :as ctx}]
(assoc-in ctx [:effects :db :test-changed] true))}))
@CalebMacdonaldBlack
CalebMacdonaldBlack / example.sh
Created Nov 22, 2017
Example shell script template/boilerplate
View example.sh
#!/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