Skip to content

Instantly share code, notes, and snippets.

Oliver Powell greywolve

Block or report user

Report or block greywolve

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
@greywolve
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
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 {}))]
(cond
;; attribute
(:db/valueType e)
(merge em {:db/id (d/tempid :db.part/db)
You can’t perform that action at this time.