Skip to content

Instantly share code, notes, and snippets.

@stuartsierra
stuartsierra / one.clj
Last active Apr 2, 2020
Example Clojure Gist with multiple files
View one.clj
(ns one)
(defn example-function []
(println "Hello from example.one"))
@stuartsierra
stuartsierra / pair_indent.clj
Last active Nov 12, 2019
Demonstration of pair-wise indentation for Clojure syntax
View pair_indent.clj
;; Demonstration of pair-wise indentation for Clojure syntax
(let [local-symbol-one
(expression-to-compute-symbol-one)
local-symbol-two
(expression-to-compute-symbol-two)]
(body-expressions))
(def a-map
{:com.example.application/one
@stuartsierra
stuartsierra / testcomponentclojureversion.sh
Created Sep 9, 2019
Script to test behavior of transitive Clojure dependencies from Component
View testcomponentclojureversion.sh
#!/bin/bash
BASEDIR=testcomponentclojureversion
rm -rf "$BASEDIR"
mkdir -p "$BASEDIR"
pushd "$BASEDIR" > /dev/null
echo ""
echo "Testing Clojure 1.8.0 and Component 0.4.0"
@stuartsierra
stuartsierra / trymacrospec.sh
Created Jul 4, 2017
Test script for macro spec in clojure.test
View trymacrospec.sh
#!/usr/bin/env bash
# Test script attempting to reproduce issue described at
# https://groups.google.com/d/topic/clojure/jASgZpaZkTc/discussion
# $ lein version
# Leiningen 2.7.1 on Java 1.8.0_92 Java HotSpot(TM) 64-Bit Server VM
lein new trymacrospec
cd trymacrospec
@stuartsierra
stuartsierra / keybase.md
Created Jan 30, 2017
keybase.io proof signature
View keybase.md

Keybase proof

I hereby claim:

  • I am stuartsierra on github.
  • I am stuartsierra (https://keybase.io/stuartsierra) on keybase.
  • I have a public key ASDk7Xv_PViS-vJcnBctOS7_65mNWx0v3geJtjsqPYODggo

To claim this, I am signing this object:

@stuartsierra
stuartsierra / gist:c5866f95513070da7f06
Created Dec 8, 2014
Emacs error after evaluating form in CIDER (0.7) REPL
View gist:c5866f95513070da7f06
error in process filter: aref: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: aref: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: aref: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: aref: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: Lisp nesting exceeds `max-lisp-eval-depth'
error in process filter: save-current-buffer: Variable binding depth exceeds max-specpdl-size
error in process filter: Variable binding depth exceeds max-specpdl-size
@stuartsierra
stuartsierra / concat.org
Created Apr 4, 2014
Demonstrations of Clojure `concat` StackOverflow
View concat.org

Concat StackOverflow

Demonstrations of how clojure.core/concat can produce a StackOverflow.

Classic concat bomb

This is the most obvious case: A loop that builds up a sequence by concatenation.

@stuartsierra
stuartsierra / project.clj
Last active Aug 29, 2015
Test G.Closure library release 0.0-20140226-71326067
View project.clj
;; Use this Leiningen project.clj file to test the new release of the
;; Google Closure library JARs, version 0.0-20140226-71326067
(defproject testproject "0.1.0-SNAPSHOT"
;; Add lein-cljsbuild or whatever else you use for ClojureScript
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2173"
:exclusions [org.clojure/google-closure-library
@stuartsierra
stuartsierra / common-dependencies.clj
Created Jan 23, 2014
Seed Maven Cache for Clojure Projects
View common-dependencies.clj
;;; Seed Dependencies for Clojure Projects
;; This file contains Leiningen-style dependencies for many
;; commonly-used Clojure and Java libraries.
;; If you put all of these dependencies in a project.clj file, you
;; will NOT get a working project! However, running `lein deps` will
;; download all of these libraries as well as their transitive
;; dependencies. This is a convenient way to "seed" the local Maven
;; repository cache on a new machine.
@stuartsierra
stuartsierra / reevaluated_types.clj
Last active Jan 4, 2016
Small demonstration of the errors that can result from reevaluating type or protocol definitions in Clojure
View reevaluated_types.clj
;; Demonstration of how re-evaluating type/protocol
;; definitions can lead to confusing errors in Clojure.
(set! *warn-on-reflection* true)
;; Create a new type Foo
(deftype Foo [x])
;; Create an instance of that type
(def a-foo (Foo. 1))
You can’t perform that action at this time.