Notes and examples of Transducers and Reducers
-
Used on collections
-
Eager evaluation only. (not lazy)
A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.
You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.
user> (defprotocol IABC
(also-oo [this])
(another-fn [this x]))
IABC
A hopefully short and concise explanation as to how Om/React.js works. This probably isn't for you if you already use ClojureScript or Om.
The front end and JavaScript God known as David Nolen created a ClojureScript library called Om. Om is a front end library that uses React.js and makes web MVC not just obsolete, but an anti-pattern.
In Om there's just the data and the view.
(defn current-web-port [] | |
(as-> js/document x | |
(-> x .-URL str) | |
(or (re-find #":(\d+)/" x) | |
(re-find #":(\d+)" x)) | |
(or (last x) 80))) | |
(defn current-domain [] (.-domain js/document)) | |
(defn websocket-path [& [path]] |
(require | |
'[cljs.repl :as repl] | |
'[cljs.repl.node :as node]) | |
(compile 'cljs.repl.node) | |
(repl/repl* (node/repl-env) | |
{:output-dir "out" | |
:optimizations :none | |
:cache-analysis true |
(defn object->clj | |
"My personal utility for converting NodeJS objects. | |
Somtimes js->clj doesn't work..." | |
[object] | |
(let [props (.keys js/Object object) | |
ret (transient {})] | |
(amap props | |
idx | |
_ | |
(let [prop (aget props idx)] |
# Arch Linux Install dpkg | |
yaourt -S dpkg | |
# Fetch Latest | |
wget -O latest.html -k https://downloads.iridiumbrowser.de/ubuntu/pool/main/i/iridium-browser/ | |
# Find AMD64 Packages |
find ./ -type d -maxdepth 1 -iname '.*' -exec echo {}/* \; | sed s/\\.\\///g | sed s/^\\/\\*//g > .gitignore | |
git add .gitignore | |
git add . |