This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.NoClassDefFoundError: scala/reflect/internal/Trees | |
at java.lang.ClassLoader.defineClass1(Native Method) | |
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) | |
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) | |
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) | |
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "nREPL-worker-0" java.lang.IllegalArgumentException: Cannot write value of type class java.lang.Double | |
at clojure.tools.nrepl.bencode$eval46272$fn__46273.invoke(bencode.clj:326) | |
at clojure.lang.MultiFn.invoke(MultiFn.java:233) | |
at clojure.tools.nrepl.bencode$eval46307$fn__46308.invoke(bencode.clj:398) | |
at clojure.lang.MultiFn.invoke(MultiFn.java:233) | |
at clojure.tools.nrepl.bencode$eval46307$fn__46308.invoke(bencode.clj:398) | |
at clojure.lang.MultiFn.invoke(MultiFn.java:233) | |
at clojure.tools.nrepl.bencode$eval46297$fn__46298.invoke(bencode.clj:382) | |
at clojure.lang.MultiFn.invoke(MultiFn.java:233) | |
at clojure.tools.nrepl.bencode$eval46297$fn__46298.invoke(bencode.clj:382) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defrecord Reference [schema] | |
s/Schema | |
(walker [_] | |
(let [sub-walker (s/subschema-walker schema)] | |
(fn [x] (sub-walker @x)))) | |
(explain [_] (list 'reference (s/explain schema)))) | |
(defn reference | |
[schema] | |
(Reference. schema)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; CORS | |
(def ^:const ^:private allowed-cors-headers | |
(str/join ", " #{"Authorization" | |
"Content-Type" | |
"If-Match" | |
"If-Modified-Since" | |
"If-None-Match" | |
"If-Unmodified-Since" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns com.example.util | |
(:import [clojure.core.async.impl.channels ManyToManyChannel]) | |
(:require [clojure.core.async :as async])) | |
(defn retry | |
[f & {:keys [out-ch retries delay]}] | |
{:pre [(and (integer? retries) (pos? retries)) | |
(integer? delay) | |
(instance? ManyToManyChannel out-ch)]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as str]) | |
(require '[clojure.test.check.generators :as gen]) | |
(def gen-hex-char | |
(gen/elements (concat (map char (range (int \a) (int \f))) | |
(range 0 9)))) | |
(defn gen-hex-string [len] | |
(gen/fmap str/join (gen/vector gen-hex-char len len))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Make sure to require this file before you run your tests, and after any other | |
;; library that uses the same clojure.test hooks. | |
;; | |
;; NOTE: This doesn't work if you run your tests with `lein difftest`. | |
(ns example.test | |
(:require [clojure.pprint :refer [print-table]] | |
[clojure.test :refer [report with-test-out]])) | |
(def ^:private ^:const slow "in seconds" | |
0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clj-time.core :as t]) | |
(require '[clj-time.format :as f]) | |
(defn parse-date [s] | |
(.. (f/formatter (t/default-time-zone) | |
"YYYY-MM-dd'T'HH:mm:ss.SSSZZ" | |
"YYYY-MM-dd'T'HH:mm:ssZZ" | |
"YYYY-MM-dd HH:mm:ss ZZ" | |
"EEE MMM dd YYYY HH:mm:ss zZ '('z')'") | |
withOffsetParsed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clj-time.format :as f]) | |
(def javascript-date-string-formatter | |
(f/formatter "EEE MMM dd YYYY HH:mm:ss zZ '('z')'")) | |
(f/parse javascript-date-string-formatter "Tue Feb 24 2015 13:09:43 GMT+0000 (GMT)") | |
;; => #<DateTime 2015-02-24T13:09:43.000Z> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes you want origin branches, ignoring `master`. | |
# Don't forget to to update your list of remote branches. | |
git remote prune origin | |
git branch -r --merged | \ | |
awk '/origin/ && ! /HEAD/ && !/master/ { split($0, x, "/"); print x[2] }' | \ | |
xargs -I x git push origin --delete x |