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
org.clojure/clojure 1.10.0-alpha4 | |
org.clojure/core.specs.alpha 0.1.24 | |
org.clojure/spec.alpha 0.1.143 | |
metosin/muuntaja 0.5.0 | |
com.fasterxml.jackson.core/jackson-core 2.9.3 | |
com.cognitect/transit-clj 0.8.300 | |
com.cognitect/transit-java 0.8.324 | |
org.msgpack/msgpack 0.6.12 | |
com.googlecode.json-simple/json-simple 1.1.1 | |
org.javassist/javassist 3.18.1-GA |
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
{:deps | |
{org.clojure/clojure {:mvn/version "1.10.0-alpha4"} | |
ring/ring-core {:mvn/version "1.6.3"} | |
metosin/reitit-core {:mvn/version "0.1.1-SNAPSHOT"} | |
metosin/reitit-ring {:mvn/version "0.1.1-SNAPSHOT"} | |
http-kit {:mvn/version "2.2.0"}}} | |
;; | |
;;├── deps.edn | |
;;├── public |
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 update-stats | |
"Take a collection of pages and update stats (fns)." | |
[pages & [fns]] | |
(let [fns (or fns [update-stat1 update-stat2 clean-page]) | |
xform (apply comp (map (partial map) fns)) ;;create transducer from | |
;;collection of functions | |
in-chan (async/chan 1) | |
out-chan (async/chan 1)] | |
(async/onto-chan in-chan pages) |
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
(d/pull-many db '[*] | |
(apply sorted-set | |
(concat | |
(d/q '[:find [?e ...] | |
:in [?tag ...] $ | |
:where | |
[?e :tags ?tag]] | |
search-tags | |
db) | |
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 upload-file.core | |
(:require [reagent.core :refer [render atom]] | |
[cljs.core.async :refer [put! chan <! >!]]) | |
(:require-macros [cljs.core.async.macros :refer [go go-loop]])) | |
;; derived from https://mrmcc3.github.io/post/csv-with-clojurescript/ | |
;; and based on reagent-frontend template. | |
;; dependencies from project.clj in addition to clojure, clojurescript, and reagent: | |
;; [org.clojure/core.async "0.2.395"] |
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
(re-frame/reg-event-db | |
:db/initialize-iota | |
(fn [db [_ v]] | |
(let [state (make-state)] | |
(assoc db :state state)))) | |
(re-frame/reg-event-fx | |
:db/initialize-iota-mam |
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
Raspberry Pi | |
https://www.amazon.com/CanaKit-Raspberry-Ultimate-Starter-Kit/dp/B01C6Q4GLE/ | |
DHT22: Temperature and Humidity | |
https://www.arrow.com/en/products/sen0137/dfrobot | |
DS18B20: Temperature and Humidity | |
https://www.arrow.com/en/products/374/adafruit-industries | |
Power Relays |
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 '[thi.ng.geom.core :as g] | |
'[thi.ng.geom.core.vector :as v] | |
'[thi.ng.geom.spatialtree :as t]) | |
(defn update-tree [tree] | |
(fn [agents] | |
(reduce | |
#(g/add-point % %2 %2) | |
(g/clear! tree) ;;works with (t/set-children tree nil) | |
agents))) |
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
(set-env! | |
:source-paths #{"src/cljs" "src/clj" "src/cljc"} | |
:resource-paths #{"resources" } | |
:dependencies '[[org.clojure/clojure "1.9.0-alpha17"] | |
[org.clojure/clojurescript "1.9.908"] | |
[adzerk/boot-cljs-repl "0.3.3"] | |
[adzerk/boot-cljs "2.1.2" :scope "test"] | |
[adzerk/boot-reload "0.5.1" :scope "test"] | |
[pandeiro/boot-http "0.8.3" :scope "test"] |
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 some-app.core | |
(:require [reagent.core :as r] | |
[cljsjs.react-input-autosize])) | |
(def autosize-input (r/adapt-react-class "AutosizeInput")) | |
(defn editor [state] | |
[:div.editor | |
[autosize-input {:value "Hello" | |
:name "some-name" |