Stay cool Clojurists 😎
Usage:
clj -Sdeps '{:deps {cool {:git/url "https://gist.github.com/alex-dixon/bf2218ed3d3c633ed0602e23ae76c420" :sha "a9859300b5af48a18c88bdec2feb28bc91bd9d80"}}}' -m cool
| ### Keybase proof | |
| I hereby claim: | |
| * I am alex-dixon on github. | |
| * I am alexdixon (https://keybase.io/alexdixon) on keybase. | |
| * I have a public key ASBAkk6q6ylqzdp0aCp94qhC_sfaKyUHifuzJBR0GvTaAQo | |
| To claim this, I am signing this object: |
Stay cool Clojurists 😎
Usage:
clj -Sdeps '{:deps {cool {:git/url "https://gist.github.com/alex-dixon/bf2218ed3d3c633ed0602e23ae76c420" :sha "a9859300b5af48a18c88bdec2feb28bc91bd9d80"}}}' -m cool
Problem: I want to spec a coll of maps. I know I can use s/coll-of and specify :kind vector? or :kind list?,
but either is fine, so I've omitted it. When I call s/explain for this spec with a map it fails properly,
but I get explain data for each map entry that says "x" isn't a map. I'd prefer it say it's not a collection and stop there.
Solution:
(s/def ::example (s/coll-of (s/keys :req-un [::foo]) | (defmacro deflet [bindings & body] | |
| `(do ~@(for [[sym expr] (partition 2 (destructure bindings))] | |
| (list 'def sym expr)) | |
| ~@body)) | |
| (defmacro defbindings [bindings] | |
| `(do ~@(for [[sym expr] (partition 2 (destructure bindings))] | |
| (list 'def sym expr)))) | |
| (defmacro deflast [sym] |
| (ns myapp.typeahead | |
| (:require [reagent.core :as r] | |
| [goog.functions :as gf] | |
| [myapp.api :as api])) | |
| (defn input-control [props] | |
| (let [value (r/atom (:default-value props "")) | |
| local-change #(reset! value (.. % -target -value))] | |
| (fn [{:keys [on-change] :as props}] |
| (def my-ns 'precept.app-ns) | |
| my-ns ;; => precept.app-ns | |
| (ns-interns my-ns) ;; nth not supported on Symbol | |
| (ns-interns 'precept.app-ns) ;; works | |
| (ns-interns (quote precept.app-ns)) ;; works | |
| 'precept.app-ns ;; => precept.app-ns | |
| (quote precept.app-ns) ;; => precept.app-ns |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| onDrop: function(e) { | |
| e.preventDefault(); | |
| this.setState({ | |
| isDragActive: false | |
| }); | |
| var files; | |
| if (e.dataTransfer) { | |
| files = e.dataTransfer.files; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| // Chapter 3 Exercises |