Skip to content

Instantly share code, notes, and snippets.

View gh-56-stack-trace
Feb 03, 2014 1:31:19 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: org.apache.maven.model.io.DefaultModelReader
java.lang.NoClassDefFoundError: org/apache/maven/model/InputSource
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getDeclaredMethods(Class.java:1855)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:664)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:155)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:585)
@m0smith
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
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))]
app)))
@m0smith
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)]
(foo)))
@m0smith
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 diwithctx.clj
(defnctx-keys foo [db]
(update! db "foo")))
(defnctx app [_ (foo)])
(apply-ctx app (init-context))
@m0smith
m0smith / direader2.clj
Created Apr 17, 2014
Transform reader monad
View direader2.clj
(defn foo* [context]
(let [db (get context :db)]
(update! db "foo")))
(defn app* [context]
(let [_ (foo* context)]))
@m0smith
m0smith / direader.clj
Created Apr 17, 2014
Dependency Injection in Clojure 5.1 - Reader Monad
View direader.clj
(defn foo []
(domonad reader-m [db (asks :db)]
(update! db "foo")))
(defn app []
(domonad reader-m [_ (foo)]))
((app) (init-context))
@m0smith
m0smith / malabar-flycheck.el
Created Dec 10, 2014
Trying to get a flycheck checker that will be a callback from url-retrieve
View malabar-flycheck.el
(require 'flycheck)
(defun malabar-flycheck-command ( checker cback )
"Use flycheck to search the current buffer for compiler errrors."
(if (not (comint-check-proc "*groovy*"))
(funcall cback 'finished nil)
(let* ((pom (ede-find-project-root "pom.xml"))
(pom-path (format "%spom.xml" pom))
(script (if (buffer-modified-p) (buffer-file-name) (buffer-file-name))))
@m0smith
m0smith / tooling.out
Created Mar 19, 2015
Sample groovysh using Gradle Tooling
View tooling.out
Groovy Shell (2.3.7, JVM: 1.7.0_45)
Type ':help' or ':h' for help.
groovy:000>
malabar = { classLoader = new groovy.lang.GroovyClassLoader();
Map[] grapez = [[group: 'com.software-ninja' , module:'malabar', version:'2.3.2-SNAPSHOT']];
groovy.grape.Grape.grab(classLoader: classLoader, grapez);
classLoader.loadClass('com.software_ninja.malabar.MalabarStart').newInstance().startCL(classLoader); };
malabar();
groovy:000> malabar = { classLoader = new groovy.lang.GroovyClassLoader();
You can’t perform that action at this time.