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 / bug_fix.clj
Created Aug 26, 2019
Fixes StackOverflowError with Cider, Datomic Ions and Nrepl
View bug_fix.clj
(ns bug-demo
(:require [datomic.ion.cast :as cast]
[ :refer [output-stream]]))
(cast/initialize-redirect :stderr) ; instead of :stdout
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})
m0smith / bug_demo.clj
Created Aug 26, 2019
Shows a problem with stackover flow using cider and datomic ions
View bug_demo.clj
(ns bug-demo
(:require [datomic.ion.cast :as cast]
[ :refer [output-stream]]))
(cast/initialize-redirect :stdout)
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})
m0smith / kaocha-deps.edn
Last active Aug 14, 2019
Koacha setup in deps.edn for use with Bitbucket Pipeline
View kaocha-deps.edn
:kaocha {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "0.0-529"}
lambdaisland/kaocha-junit-xml {:mvn/version "0.0-70"}
lambdaisland/kaocha-cloverage {:mvn/version "0.0-32"}
cloverage {:mvn/version "RELEASE"}
:main-opts ["-m" "kaocha.runner"
"--plugin" "kaocha.plugin/junit-xml"
"--plugin" "cloverage" "--no-cov-summary"
"--junit-xml-file" "target/test-results/junit.xml"]}
m0smith /
Created Feb 2, 2017
VC scripts for unified SVN and GIT
import os
import subprocess
import sys
commands ={ ".svn" : ["svn","-u","status"],
".git" : ["git", "status"] }
def parent_dirs(f_or_d):
View resource-in-archives.el
(defun list-to-hash (coll)
(let ((rtnval (make-hash-table :test 'equal)))
(cl-loop for r across coll
when r
do (puthash (elt r 1) nil rtnval))
(defun jdee-open-source-resource-in-archive-p (archive resource)
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.
malabar = { classLoader = new groovy.lang.GroovyClassLoader();
Map[] grapez = [[group: '' , module:'malabar', version:'2.3.2-SNAPSHOT']];
groovy.grape.Grape.grab(classLoader: classLoader, grapez);
classLoader.loadClass('com.software_ninja.malabar.MalabarStart').newInstance().startCL(classLoader); };
groovy:000> malabar = { classLoader = new groovy.lang.GroovyClassLoader();
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))))
View diwithctx.clj
(defnctx-keys foo [db]
(update! db "foo")))
(defnctx app [_ (foo)])
(apply-ctx app (init-context))
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 / 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))
You can’t perform that action at this time.