Skip to content

Instantly share code, notes, and snippets.

@minimal
minimal / link_to_repo.clj
Created April 12, 2022 09:49
babashka script to symlink shell.nix, .envrc etc
(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
;; minimally, install use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
#!/usr/bin/env bash
# check formatting of clj files changed from master
lein cljfmt check $(git diff --name-only origin/master |
grep "\\.clj[sc]\\?$" |
paste -s -d" ")
(s/fdef defspec-test
:args (s/cat :name simple-symbol?
:sym-or-syms any?
:rest (s/? (s/cat
:num-tests (s/or :int (s/nilable int?) :form list?)
:last (s/? (s/cat :opts (s/nilable map?)))))))
(defmacro defspec-test
([name sym-or-syms] `(defspec-test ~name ~sym-or-syms nil nil))
([name sym-or-syms num-tests] `(defspec-test ~name ~sym-or-syms ~num-tests nil))
@minimal
minimal / build.boot
Last active September 21, 2016 16:38
Clojurescript & boot app release version and sentry integration
(import
'[java.time ZonedDateTime]
'[java.time.format DateTimeFormatter])
;; add a RELEASE closure define with the current iso date, RAVEN_DSN from env var
(deftask production []
(task-options! cljs {:optimizations :advanced
:compiler-options {:closure-defines {"goog.DEBUG" false
"myapp.core.RAVEN_DSN" (System/getenv "RAVEN_DSN")
"myapp.core.RELEASE" (.. (ZonedDateTime/now)
@minimal
minimal / data.clj
Created September 21, 2016 13:37
ISO now date string in java 8 with clojure
(import
'[java.time ZonedDateTime]
'[java.time.format DateTimeFormatter])
(.. (ZonedDateTime/now) (format DateTimeFormatter/ISO_INSTANT))
(defmacro with-err-str
[& body]
`(let [s# (new java.io.StringWriter)]
(binding [*err* s#]
~@body
(str s#))))
(defn get-stack-trace-str
[e]
(with-err-str (clojure.repl/pst e)))

Keybase proof

I hereby claim:

To claim this, I am signing this object:

(ns player-ladder.test-util
(:require [clojure.data :as data]
[clojure.pprint :as pp]
[clojure.string :as str]
[clojure.test :refer :all]))
(defn diff->string [diffs]
(str/join
(for [[actual [a b]] diffs
@minimal
minimal / lig.diff
Created November 4, 2015 22:10
emacsligpatch
diff --git a/src/composite.c b/src/composite.c
index 0f729bc..80e15f1 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1727,20 +1727,45 @@ should be ignored. */)
if (NILP (string))
{
- if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
- error ("Attempt to shape unibyte text");