- High level overview https://yogthos.github.io/ClojureDistilled.html
- An Animated Introduction to Clojure https://markm208.github.io/cljbook/
- Interactive tutorial in a browser https://tryclojure.org/
- Interactive exercises http://clojurescriptkoans.com/
- Clerk notebooks with introductory examples https://github.clerk.garden/anthonygalea/notes-on-clojure
- More interactive exercises https://4clojure.oxal.org/
- Lambda Island tutorials https://lambdaisland.com/
- Functional Programming with Clojure resources https://practicalli.github.io/
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
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;}); |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Commentary ;; | |
;; ;; | |
;; The goal for writing this started with the idea to have tests run in ;; | |
;; parallel using the leiningen plugin eftest ;; | |
;; https://github.com/weavejester/eftest. ;; | |
;; ;; | |
;; With tests using with-redefs, it was not possible to run them in ;; | |
;; parallel if they were changing the root binding of the same ;; | |
;; vars. Here, we are binding the root of the var to one function that ;; |
Note: These workarounds covered issues in
lein-tools-deps
0.3.0-SNAPSHOT
. If using0.4.1
or later, you should not encounter the issues below.
The following provides some workarounds for some issues when using lein-tools-deps
from Cursive on macOS.
By default, the lein-tools-deps
plugin won't see /usr/local/bin/clojure
when Cursive processes project.clj
, as it evidently has a degenerate path.
You will see an error like the following in the IntelliJ Event Log when it tries to process your project.clj
file:
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 '[datomic.api :as d]) | |
(defn last-touched-tx | |
"Return the tx of the oldest assertion on `entity` or any of its components." | |
[db entity] | |
(or (d/q '[:find (max ?tx) . | |
:in $ % ?root | |
:where | |
(component-entities ?root ?ce) | |
(union ?root ?ce ?e) | |
[?e _ _ ?tx]] |
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
(defn nth' [coll n] | |
(transduce (drop n) (completing #(reduced %2)) nil coll)) | |
(defn tree-seq' | |
[branch? children root] | |
(eduction (take-while some?) (map first) | |
(iterate (fn [[node pair]] | |
(when-some [[[node' & r] cont] (if (branch? node) | |
(if-some [cs (not-empty (children node))] | |
[cs pair] |
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 '[cljs.build.api :as api] | |
'[clojure.string :as string] | |
'[figwheel-sidecar.repl-api :as figwheel] | |
'[figwheel-sidecar.components.nrepl-server :as figwheel.nrepl]) | |
(def source-dir "src") | |
(def compiler-config | |
{:main 'app.main | |
:output-to "target/app.js" |
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.spec.alpha :as s]) | |
[:h1 {} "0" 1 [:span]] | |
(s/def :hiccup/form | |
(s/or | |
:string string? | |
:number number? | |
:element :hiccup/element)) |
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
(defn nth' [coll n] | |
(transduce (drop n) (completing #(reduced %2)) nil coll)) | |
(defn tree-seq' | |
[branch? children root] | |
(eduction (take-while some?) (map first) | |
(iterate (fn [[node pair]] | |
(when-some [[[node' & r] cont] (if (branch? node) | |
(if-some [cs (not-empty (children node))] | |
[cs pair] |