Skip to content

Instantly share code, notes, and snippets.

Ian Truslove iantruslove

Block or report user

Report or block iantruslove

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

Keybase proof

I hereby claim:

  • I am iantruslove on github.
  • I am iantruslove ( on keybase.
  • I have a public key ASCHv0Fr-8GYr23bj7u5BqSAnBn1sbMe_ayza9qIWzjx9Qo

To claim this, I am signing this object:

View core.clj
(ns specfoo.core
(:require [clojure.spec.gen.alpha :as gen]
[clojure.spec.alpha :as s]))
(distinct (remove coll? (gen/sample (s/gen any?) 100)))
iantruslove / profiles.clj
Last active Jan 20, 2018
Clojure debugging: local setup
View profiles.clj
;; ~/.lein/profiles.clj
{:user {:source-paths ["/Users/ian/.lein/src"]
:injections [(require 'spyscope.core)]
:dependencies [[evalive "1.1.0"]
[spyscope "0.1.7-SNAPSHOT"]]
iantruslove / patch-sexp-fu.txt
Created Jun 28, 2017
Fixing the "‘preceding-sexp’ is an obsolete function (as of 25.1)" emacs startup error
View patch-sexp-fu.txt
Check out this (sadly unmerged) PR:
replacing preceding-sexp with elisp--preceding-sexp by danielschranz · Pull Request #3 · hchbaw/eval-sexp-fu.el
This is to avoid the obsolete warning in Emacs 25.1 (see:
find your eval-sexp-fu source file, and patch it - there's 2 replacements of preceding-sexp with elisp--preceding-sexp
the file is something like ~/.emacs.d/elpa/eval-sexp-fu-20131230.1351/eval-sexp-fu.el
iantruslove /
Last active Aug 31, 2019
Den of Clojure - Intro to Clojure part 1

A gentle introduction to Clojure

Lisp Cycles (XKCD 297 /

Ian Truslove

Den of Clojure



A gentle introduction to Clojure

Lisp Cycles (XKCD 297 /

Ian Truslove

NoCo Web Scale


iantruslove / math-test.clj
Last active Oct 13, 2015
Numerically stable math
View math-test.clj
(ns jupiter.test.utils.math
(:require [clojure.test :refer :all]
[jupiter.utils.math :refer :all]))
(defn float=
([x y] (float= x y 0.000001))
([x y epsilon]
(let [scale (if (or (zero? x) (zero? y)) 1 (Math/abs x))]
(<= (Math/abs (- x y)) (* scale epsilon)))))
iantruslove /
Last active Sep 10, 2015
Den of Clojure | Real Projects | Jupiter

Den of Clojure



Den of Clojure, 2015-09-10

Ian Truslove@iantruslove

iantruslove /
Created May 11, 2015
English stop words in Lucene (lucene-5.1.0/analysis/common/src/java/org/apache/lucene/analysis/core/
static {
final List<String> stopWords = Arrays.asList(
"a", "an", "and", "are", "as", "at", "be", "but", "by",
"for", "if", "in", "into", "is", "it",
"no", "not", "of", "on", "or", "such",
"that", "the", "their", "then", "there", "these",
"they", "this", "to", "was", "will", "with"
final CharArraySet stopSet = new CharArraySet(stopWords, false);
ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet);
You can’t perform that action at this time.