Skip to content

Instantly share code, notes, and snippets.

John Kealy jdkealy

Block or report user

Report or block jdkealy

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
View clojure
ERROR in (you-get-notifications) (Util.java:177)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.StackOverflowError: null
at clojure.lang.Util.dohasheq (Util.java:177)
clojure.lang.Util.hasheq (Util.java:168)
clojure.lang.PersistentHashMap.hash (PersistentHashMap.java:120)
clojure.lang.PersistentHashMap$TransientHashMap.doAssoc (PersistentHashMap.java:324)
clojure.lang.ATransientMap.assoc (ATransientMap.java:64)
clojure.lang.PersistentHashMap.create (PersistentHashMap.java:78)
View gist:1eea2d3f04122435487844c4c68f7c58
:cljsbuild {:builds {:app {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-to "target/cljsbuild/public/js/app.js"
:externs ["resources/public/js.js"
"resources/externs/pica.ext.js"
"resources/externs/moment.ext.js"
"resources/externs/jquery.ext.js"
"resources/externs/jquery-ui.ext.js"
"resources/externs/materialize.ext.js"
"resources/externs/mdl.ext.js"
"resources/externs/lodash.ext.js"
View gist:a8be3bbf074339cc03c93a7b1df0f837
:figwheel {:http-server-root "public"
:compile {:recompile-dependents false}
:server-port 3449
:hawk-options {:watcher :polling}
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:nrepl-middleware ["cemerick.piggieback/wrap-cljs-repl"]
:ring-handler im.handler/app}
View gist:5d9be91b589b80c41ab5e4d129474666
(defn watermark-arguments [{:keys [id] :as message}]
[(:watermark message)
(:watermark-out message)
"bfa.co/"
"-font" (str (System/getProperty "user.dir") "/resources/public/webfonts/31D41C_0_0.ttf")
"-fill" "white"
"-gravity" "west"
"-pointsize" "32"
"-font" (str (System/getProperty "user.dir") "/resources/public/webfonts/31D41C_0_0.ttf")
"-annotate" "+5+25"
View gist:75451acf435a877df198abe4a028042c
(defn max-fk-for-org
"query runs way too slow"
[org]
(ffirst
(d/q '[:find (max ?fk)
:in $ ?org
:where
[?collection :collection/organization ?org]
[?content :content/collection ?collection]
[?content :content/fk ?fk]]
View gist:b9d62366c46ba078051bad849e82c200
(defn max-fk [org]
(ffirst
(d/q '[:find (max ?fk)
:in $ ?org
:where
[?collection :collection/organization ?org]
[?content :content/collection ?collection]
[?content :content/fk ?fk]]
(db/_d) org)))
View gist:174741e33b88b09b66e6f0281e3cd6ca
(defn cart-line-items [cid _db & [organization]]
(d/q '[:find ?e ?org ?name ?price ?dl_or_ph
:in $ ?cart
:where
[?e :line_item/cart ?cart]
[?cart :cart/subtotal ?subtotal]
[?e :line_item/content ?content]
[?e :line_item/dl_or_ph ?dl_or_ph]
[?e :line_item/price ?price]
[?content :content/collection ?coll]
View gist:b74e35083aad38428b2587d182bd6144
(let [c (chan)]
(go
(let [func (fn [] (>! c "callback"))]
(.toDataUrl js/window img (fn [res]
(swap! items #(conj % [res name]))
(swap! zips-atom #(-> %
(assoc-in [(:db/id item) :downloaded] (count @items))))
(func)
(do-zip))))
(let [res (<! c)]
View gist:d6f49c83246616d537e3c393d501dfc8
(doall
(map (fn [[img name]]
(let [c (chan)]
(go
(.toDataUrl js/window img (fn [res]
(swap! items #(conj % [res name]))
(go
(>! c "CALLBACK"))
(do-zip)))
(let [res (<! c)]
View gist:50b1e64f27f5973054b0ce99c313de95
(d/q '[:find ?e ?email
:in $ ?ent
:where
[?e :permission/ent ?ent]
(or
(and
[?e :permission/user ?user]
[?user :user/email ?email])
[?user :permission/email ?email])]
_db id)
You can’t perform that action at this time.