Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris McDevitt minimal

  • London
View GitHub Profile
View emacs-config.el
(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))
View cljfmt-check-changed-files.sh
#!/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" ")
View test_util.clj
(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 Sep 21, 2016
Clojurescript & boot app release version and sentry integration
View build.boot
(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 Sep 21, 2016
ISO now date string in java 8 with clojure
View data.clj
(import
'[java.time ZonedDateTime]
'[java.time.format DateTimeFormatter])
(.. (ZonedDateTime/now) (format DateTimeFormatter/ISO_INSTANT))
View run.clj
(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)))
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

View test_util.clj
(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
View lig.diff
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");
@minimal
minimal / error.el
Created Oct 31, 2015
ligature hack breaks in minibuffer
View error.el
Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil)
read-from-minibuffer: Attempt to shape unibyte textError during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p ni\
l) [52 times]
read-from-minibuffer: Attempt to shape unibyte text
Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil)
read-from-minibuffer: Attempt to shape unibyte textError during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p ni\
l) [64 times]
read-from-minibuffer: Attempt to shape unibyte text
You can’t perform that action at this time.