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
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]
[clojure.java.io :refer [output-stream]]))
(cast/initialize-redirect :stderr) ; instead of :stdout
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})
@m0smith
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]
[clojure.java.io :refer [output-stream]]))
(cast/initialize-redirect :stdout)
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})
@m0smith
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
m0smith / vc.py
Created Feb 2, 2017
VC scripts for unified SVN and GIT
View vc.py
#!/usr/local/bin/python
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))
rtnval))
(defun jdee-open-source-resource-in-archive-p (archive resource)
""
@m0smith
m0smith / hibernate-clojure.clj
Created Sep 28, 2011
Proof of concept of using clojure and hibernate
View hibernate-clojure.clj
(ns topoged.model.type
(:import
(javax.persistence Entity Id Column Table GeneratedValue)
))
(definterface IType (getId []))
(deftype
^{Entity {} Table {:name="TYPE"} org.hibernate.annotations.Entity {:mutable false}}
TypeX [^Long id]
@m0smith
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"))
ecb-activate--impl()
ecb-activate-internal()
ecb-minor-mode(1)
ecb-activate()
call-interactively(ecb-activate record nil)
command-execute(ecb-activate record)
@m0smith
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 https://delicious.com/developers/rssurls
View wkp_Delicious.php
<?php
/*
* Written by Matthew O. Smith <m0smith@yahoo.com>
* 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
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 (?,?,?,?,?,?)
NestedThrowables:
SQL Exception: An SQL data change is not permitted for a read-only connection, user or database.
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
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."
[name]
(let [out (chan)]
(go (while true (>! out [name (rand-nth MOVES)])))
You can’t perform that action at this time.