Fire up a REPL using any of the following forms.
clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:git/url "https://github.com/mfikes/clojurescript" :sha "ed1e7373a9ecd8b52084dc438e6c21d23dba47ca"}}}' -m cljs.main -re node
#!/bin/sh | |
#_( | |
#_DEPS is same format as deps.edn. Multiline is okay. | |
DEPS=' | |
{:deps {clj-time {:mvn/version "0.14.2"}}} | |
' | |
#_You can put other options here | |
OPTS=' |
#!/usr/bin/env python3 | |
# So I asked Greater Goods if they would point me in the direction of their API. So I could get data | |
# from their WiFi scale without the limitations of their Weight Gurus app. They said they don't give | |
# that out. So my options are to return the scale to Amazon because it is useless to me without an | |
# API or I figure it out myself. Anyway, I figured it out so you don't have to return your scale. | |
# This isn't an API but from here you can atleast access the data. | |
# If you don't already have the scale you can find it on Amazon | |
# UPC 875011003964 |
(defn code-mirror | |
"Create a code-mirror editor. The parameters: | |
value-atom (reagent atom) | |
when this changes, the editor will update to reflect it. | |
options | |
:style (reagent style map) | |
will be applied to the container element | |
:js-cm-opts | |
options passed into the CodeMirror constructor | |
:on-cm-init (fn [cm] -> nil) |
(defn seq!! | |
"Returns a (blocking!) lazy sequence read from a channel." | |
[c] | |
(lazy-seq | |
(when-let [v (<!! c)] | |
(cons v (seq!! c))))) | |
(comment | |
(def stream (chan)) | |
(go (dotimes [x 16] |
;;; Written when pondering | |
;;; http://stackoverflow.com/questions/9086926/create-a-proxy-for-an-specific-instance-of-an-object-in-clojure | |
(defmacro delegating-proxy [o class-and-ifaces ctor-args & impls] | |
(let [oname (gensym)] | |
(letfn [(delegating-impls [^java.lang.reflect.Method ms] | |
(let [mname (symbol (.getName ^java.lang.reflect.Method (first ms))) | |
arity-groups (partition-by #(count (.getParameterTypes ^java.lang.reflect.Method %)) ms) | |
max-arity (max-key #(count (.getParameterTypes ^java.lang.reflect.Method %)) ms)] | |
`(~mname |