See
- https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive
- https://andrearichiardi.com/blog/posts/clojurescript-cursive-shadow-setup.html
- in shadow-cljs.edn:
,,,
In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.
This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.
This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!
You don't need to know or care about blockchains to understand the code be
(ns talk | |
(:require [overtone.core :refer :all] | |
[clojure.java.io :as io])) | |
;; Overtone by Sam Aaron & Jeff Rose | |
;; https://github.com/overtone/overtone | |
(definst da-funk [freq 440 dur 1.0 amp 1.0 cutoff 1700 boost 6 dist-level 0.015] | |
(let [env (env-gen (adsr 0.3 0.7 0.5 0.3) (line:kr 1.0 0.0 dur) :action FREE) | |
filter-env (+ (* freq 0.15) |
(require '[clj-http.client :as http]) | |
(require '[clojure.core.async :as a]) | |
(require '[clojure.string :as string]) | |
(require '[clojure.java.io :as io]) | |
(import '[java.io InputStream]) | |
(def event-mask (re-pattern (str "(?s).+?\r\n\r\n"))) | |
(defn- parse-event [raw-event] | |
(->> (re-seq #"(.*): (.*)\n?" raw-event) |
This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.
Forked from https://gist.github.com/dergachev/4627207. Updated to use a palette to improve quality and skip gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
Since an embedded JavaScriptCore can be made to launch quickly, I've been pondering whether it is justified in converting Planck to be a portable (OS X, Linux, Windows) C-based wrapper around JavaScriptCore (so that it is more broadly useful). Right now Planck is not portable owing to the use of Cocoa/Foundation and Objective-C.
I think this partially boils down to wether the launch latency is faster than an equivalent based on Node.js (which is already portable and has a much richer ecosystem). That latency has to be significantly different, and I also think you'd need to be convinced that it is going to remain that way (perhaps V8 will be further optimized, but perhaps the outright launch speed of Node.js isn't a priority).
(ns wall-jiggle.wall-jiggle | |
(:use arcadia.core | |
arcadia.linear) | |
(:require [arcadia.updater :as updr]) | |
(:import [UnityEngine Transform])) | |
(defscn wall | |
(let [top (GameObject. "wall")] | |
(dotimes [x 10] | |
(dotimes [y 10] |
It would be interesting if Figwheel could essentially decorate any implementation of IJavaScriptEnv
, taking on the responsibility of watching the filesystem (perhaps even delegating that to ClojureScript :watch
, and expanded :watch-fn
, and perhaps minimally calling IJavaScriptEnv -load
when Figwheel determines it is needed.
Then, for those REPLs that can participate, if IFigwheelSupport
can be extended to them, they can do further cool stuff. (Perhaps IFigwheelSupport
is actually necessary while IJavaScriptEnv
as described in the previous paragraph is insufficient, and a more fancy impl of -load
is needed?)
That way, things like the existing Node REPL could be minimally supported by Figwheel, as well as Ambly, the Browser REPL, etc.
What does IFigwheelSupport
do?
Perhaps somewhere there is a HUD interface and Figwheel can ask a REPL to display things on its HUD? An iOS or Android-specific REPL could delegate to Objective-C or Java that implement a HUD using platform-specific UI widgets
chas@t440p:~/Downloads$ java -cp cljs.jar:/home/chas/.m2/repository/org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar:/home/chas/.m2/repository/com/cemerick/piggieback/0.2.1/piggieback-0.2.1.jar clojure.main nrepl_piggieback.clj & | |
nREPL server running on port 7888 | |
# using Leiningen here _only_ to connect to the running nREPL server | |
# any nREPL client will do | |
chas@t440p:~/Downloads$ lein repl :connect 7888 | |
Connecting to nREPL at 127.0.0.1:7888 | |
REPL-y 0.3.5, nREPL 0.2.10 | |
Clojure 1.7.0-beta1 |
(ns nested-routing.core | |
(:require-macros [om.core :as om] | |
[secretary.core :refer [defroute]]) | |
(:require [om.dom :as dom] | |
[om.core :as om] | |
[secretary.core :as secretary] | |
[goog.events :as events] | |
[goog.history.EventType :as EventType]) | |
(:import goog.History)) |