Skip to content

Instantly share code, notes, and snippets.

Matthew O. Smith m0smith

Block or report user

Report or block m0smith

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
m0smith / diclosure.clj
Last active Aug 29, 2015
Dependency Injection in Clojure 4 - Closure
View diclosure.clj
(defn wrap-context [context]
(let [db (:db context})]
(letfn [
(foo [] (update! db "foo"))
(app [] (foo))]
m0smith / diarg.clj
Last active Aug 29, 2015
Depedency Injection in Clojure 3 - Function Argument
View diarg.clj
(defn foo [context]
(let [db (:db context)]
(update! db "foo")))
(defn start-app [context]
(foo context))
(start-app (init-context))
m0smith / dibinding.clj
Created Apr 16, 2014
Dependency Injection in Clojure 2 - Binding
View dibinding.clj
(def ^:dynamic *context* {})
(defn foo []
(let [db (:db *context*)]
(update! db "foo")))
(defn start-app []
(binding [*context* (init-context)]
m0smith / gist:10925790
Last active Aug 29, 2015
Dependency Injection in Clojure 1 - global (non-DI)
View gist:10925790
(def context (init-context))
(def foo []
(let [db (:db context)]
(update! db "foo")))
View gh-56-stack-trace
Feb 03, 2014 1:31:19 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting:
java.lang.NoClassDefFoundError: org/apache/maven/model/InputSource
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(
at java.lang.Class.getDeclaredMethods(
m0smith / gist:8261464
Last active Jan 2, 2016
Error running ecb-activate using Version: 20131116.1319
View gist:8261464
Debugger entered--Lisp error: (error "ECB 2.40: Errors during the layout setup of ECB. (error-type: error, error-data: (\"Variable binding depth exceeds max-specpdl-size\"))")
signal(error ("ECB 2.40: Errors during the layout setup of ECB. (error-type: error, error-data: (\"Variable binding depth exceeds max-specpdl-size\"))"))
error("ECB %s: %s (error-type: %S, error-data: %S)" "2.40" "Errors during the layout setup of ECB." error ("Variable binding depth exceeds max-specpdl-size"))
ecb-clean-up-after-activation-failure("Errors during the layout setup of ECB." (error "Variable binding depth exceeds max-specpdl-size"))
call-interactively(ecb-activate record nil)
command-execute(ecb-activate record)
m0smith / wkp_Delicious.php
Last active Dec 20, 2015
A Lionwiki plugin that will pull data from Delicious. The usage is {delicious}user/tag{/delicious}. See
View wkp_Delicious.php
* Written by Matthew O. Smith <>
* With {delicious}user/tag{/delicious} insert links from the user and tags
* With {delicious}user/tag?count=50{/delicious} you can spcifiy the number of items returned
class Delicious
var $desc = array(
m0smith / gist:6083731
Created Jul 25, 2013
Stack Trace from Archiva
View gist:6083731
javax.servlet.ServletException: javax.jdo.JDODataStoreException: Insert request failed: INSERT INTO JDOAUTHENTICATIONKEY (DATE_CREATED,PURPOSE,MODEL_ENCODING,DATE_EXPIRES,FOR_PRINCIPAL,AUTHKEY) VALUES (?,?,?,?,?,?)
SQL Exception: An SQL data change is not permitted for a read-only connection, user or database.
View rps.clj
(require 'clojure.core.async :refer :all)
(def MOVES [:rock :paper :scissors])
(def BEATS {:rock :scissors, :paper :rock, :scissors :paper})
(defn rand-player
"Create a named player and return a channel to report moves."
(let [out (chan)]
(go (while true (>! out [name (rand-nth MOVES)])))
View broken-refer.clj
(:require [clj-time.core :refer [epoch]]))
You can’t perform that action at this time.