Skip to content

Instantly share code, notes, and snippets.

View aboekhoff's full-sized avatar

Andrew Boekhoff aboekhoff

  • DemandingBear
  • San Francisco
View GitHub Profile
@aboekhoff
aboekhoff / gist:274828
Created January 12, 2010 02:41
dynamic session middleware
(ns #^{:doc "A handful of utilities for handling sessions"}
somnium.financier.app.control.session
(:refer-clojure :exclude (assoc! dissoc! get)))
;;;; declaring session var here for global-ish access to session
(def *session* {})
(def *flash* {})
(defn with-dynamic-session
var jury;
jury || (jury = {});
if(!jury.destro)jury.destro = {};
(function() {
jury.destro.foo = function(b, a) {
if(arguments.length !== 2)throw"required arity is 2";var h, c;
c = b["that-thingy"] || "bar";
var d;
d = b["this-thingy"] || "foo";
var e;
;;;; *very* quick and dirty support for javascript destructuring on
;;;; native javascript arrays and objects
(add-inline-form
get [[_ a b c]]
(str "((" a "[" b "]" ")||" c ")"))
(add-inline-form
nth [[_ a b]]
(str a "[" b "]"))
(add-inline-form