Skip to content

Instantly share code, notes, and snippets.

View greywolve's full-sized avatar

Oliver Powell greywolve

View GitHub Profile
@greywolve
greywolve / main.go
Created August 17, 2020 10:43
GoManila Cardinality Demo
package main
import (
//"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"math/rand"
"net/http"
"time"
)

#hello

@greywolve
greywolve / permissions.clj
Created July 23, 2018 07:16
Apache Shiro style permissions in Clojure
(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 October 5, 2016 08:08
Get all schema from a Datomic database, in a form that can be re-transacted.
(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)