This file contains 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 task-list [] | |
(let [visible-todos @(subscribe [:visible-todos]) | |
all-complete? @(subscribe [:all-complete?])] | |
[:section#main | |
[:input#toggle-all | |
{:type "checkbox" | |
:checked all-complete? | |
:on-change #(dispatch [:complete-all-toggle])}] | |
[:label | |
{:for "toggle-all"} |
This file contains 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 example.errors) | |
(defn clean-address [params] | |
"Ensure (params :address) is present" | |
(if (empty? (params :address)) | |
[nil "Please enter your address"] | |
[params nil])) | |
(defn clean-email [params] | |
"Ensure (params :email) matches *@*.*" |
This file contains 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
(try | |
(d/catch (d/chain (throw (ex-info "standard failure" {:type :foo}))) | |
(fn [e] | |
(println "d/catch e" (.getMessage e)))) | |
(catch Exception e | |
(println "try/catch e" (.getMessage e)))) | |
(try | |
(d/catch (d/chain (d/error-deferred (ex-info "deferred error" {:type :bar}))) | |
(fn [e] |
This file contains 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
rapper -i turtle -o dot model.ttl | dot -Tpdf -omodel.pdf |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am alexanderjamesking on github. | |
* I am ajking (https://keybase.io/ajking) on keybase. | |
* I have a public key ASD5bNI-pQZ6-aYSsCLkh8HAxsGsr2YevK3WVSSl-3HBmAo | |
To claim this, I am signing this object: |
This file contains 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 spy-example.core-test | |
(:require [clojure.test :refer [deftest testing is]] | |
[spy.core :as spy])) | |
(def beatle->email | |
{:john "[email protected]" | |
:paul "[email protected]" | |
:george "[email protected]" | |
:ringo "[email protected]"}) |
This file contains 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
(def beatle->email | |
{:john "[email protected]" | |
:paul "[email protected]" | |
:george "[email protected]" | |
:ringo "[email protected]"}) | |
(defn lookup-email [beatle-id] | |
(get beatle->email beatle-id)) | |
(defn send-message [email message] |
This file contains 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.test :refer [is]]) | |
(defn random-beatle [] | |
(case (rand-int 4) | |
0 "John" | |
1 "Paul" | |
2 "George" | |
3 "Ringo")) | |
(defn hello-beatle [get-beatle] |
This file contains 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.test :refer [is]]) | |
(defn random-beatle [] | |
(case (rand-int 4) | |
0 "John" | |
1 "Paul" | |
2 "George" | |
3 "Ringo")) | |
(defn hello-beatle [] |
NewerOlder