Skip to content

Instantly share code, notes, and snippets.


Oliver Powell greywolve

View GitHub Profile
greywolve / main.go
Created Aug 17, 2020
GoManila Cardinality Demo
View main.go
package main
import (
greywolve / permissions.clj
Created Jul 23, 2018
Apache Shiro style permissions in Clojure
View permissions.clj
(require '[clojure.set :as set])
(require '[clojure.string :as string])
(def wildcard :*)
(defn permission-string->permission [perm-str]
(->> (string/split perm-str #":")
(mapv (fn [s]
(->> (string/split s #",")
(map keyword)
greywolve / get-schema.clj
Last active Oct 5, 2016
Get all schema from a Datomic database, in a form that can be re-transacted.
View get-schema.clj
(defn get-schema [db]
(letfn [(attr->schema-tx [db attr]
(let [e (d/entity db attr)
em (->> e
(map identity)
(into {}))]
;; attribute
(:db/valueType e)
(merge em {:db/id (d/tempid :db.part/db)