Skip to content

Instantly share code, notes, and snippets.

;; setup db to test with
;; note that this setup uses a local dev transactor
;; you can use a different transactor, but you cannot
;; use a mem db because it does not support the log API
(require '[datomic.api :as d])
(def uri "datomic:dev://localhost:4334/reified-txes")
(d/delete-database uri)
(d/create-database uri)
(def conn (d/connect uri))
@timewald
timewald / gist:4635904
Created January 25, 2013 16:43
Sample of refactored Ring session middleware to separate request pre-processing and response post-processing for use with async HTTP processing.
ns ring.middleware.session
"Session manipulation."
(:require [ring.middleware.cookies :as cookies]
[ring.middleware.session.store :as store]
[ring.middleware.session.memory :as mem]))
(defn session-options
[options]
{:store (options :store (mem/memory-store))
:cookie-name (options :cookie-name "ring-session")