Skip to content

Instantly share code, notes, and snippets.

Happy prototyping with ClojureScript

Jon jiyinyiyong

Happy prototyping with ClojureScript
Block or report user

Report or block jiyinyiyong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View error.log
(defn ^{:jsdoc ["@constructor"]}
Error: TBD
at new cljs$core$ExceptionInfo (/Users/chen/repo/mvc-works/map-spec/.shadow-cljs/builds/app/dev/out/cljs-runtime/cljs/core.cljs:11309:1)
at Function.cljs$core$IFn$_invoke$arity$3 (/Users/chen/repo/mvc-works/map-spec/.shadow-cljs/builds/app/dev/out/cljs-runtime/cljs/core.cljs:11338:1)
at Function.cljs$core$IFn$_invoke$arity$2 (/Users/chen/repo/mvc-works/map-spec/.shadow-cljs/builds/app/dev/out/cljs-runtime/cljs/core.cljs:11338:1)
at Object.cljs$spec$alpha$Spec$describe_STAR_$arity$1 (/Users/chen/repo/mvc-works/map-spec/.shadow-cljs/builds/app/dev/out/cljs-runtime/map_spec/core.cljc:11:1)
at Object.cljs$spec$alpha$describe_STAR_ [as describe_STAR_] (/Users/chen/repo/mvc-works/map-spec/.shadow-cljs/builds/app/dev/out/cljs-runtime/cljs/spec/alpha.cljs:39:1)
at Object.cljs$spec$alpha$form [as form] (/Users/chen/repo/mvc-works/map-spec/.shadow-cl
jiyinyiyong / shadow-cljs.edn
Created Apr 22, 2019
Mirrors configs in shadow-cljs
View shadow-cljs.edn
:repositories {"central" {:url ""}
"clojars" {:url ""}
"maven-central" {:url ""}
"clojars-default" {:url ""}}
jiyinyiyong / pudica-history.edn
Created Mar 28, 2019
Old history data from Pudica Viewer
View pudica-history.edn
{:states {},
:router {:name :viewer},
:content {:tasks {"S1z3WZSk7X" {:id "S1z3WZSk7X",
:text "没有尾递归的介绍",
:done? false,
:sort-id "T",
:created-time 1531035908457,
:done-time nil,
:archived-time nil},
"W6GwOL21l" {:id "W6GwOL21l",
jiyinyiyong /
Last active May 26, 2019
cljs intro in FCC

ClojureScript 的开发体验(演示)


View browser-file-tree.text
├── assets
│ └── index.html
├── package.json
├── shadow-cljs.edn
├── src
│ └── app
│ ├── lib.cljs
│ └── main.cljs

函数式语言 ClojureScript 在前端开发的体验


题叶, ChenYong, 上海

Teambition, 饿了么, 积梦智能(工业大数据).

jiyinyiyong / orthogonality.text
Created Apr 12, 2018
Find a orthogonality vector based on two existing vectors
View orthogonality.text
line1 = a*i + b*j + c*k
line2 = d*i + e*j + f*k
line3 = x*i + y*j + z*k
line1 .* line3 = ax + by + cz = 0
line1 .* line3 = dx + ey + fz = 0
z = -(ax + by)/c


ClojureScript and Clojure

ClojureScript and Clojure share the same syntax but distinguish by .cljs extension name. The most different part is the difference in host platforms, like JavaScript is known as single-threaded and restricted by browser APIs.

Libraries of both sides release code on Clojars in jar files.

ClojureScript and npm

With JavaScript InterOp, you may call some JavaScript code from in Clojure syntax. ClojureScript is designed to use features from host platform. You are free to import npm modules in ClojureScript, most of them will work correctly, especially in shadow-cljs and Lumo.

jiyinyiyong /
Created Apr 4, 2018
Hijack `get`, `set` and `apply`, then everything is a lie...
createAny = (path, collector) ->
new Proxy (->),
get: (target, key, receiver) ->
createAny path.concat([key]), collector
set: (target, key, value, receiver) ->
newPath = path.concat [key]
collector ['set', newPath, value]
apply: (target, ctx, args) ->
collector ['apply', path, args]

|Lumo is a standalone ClojureScript environment that runs on Node.js and the V8 JavaScript engine. It starts up instantaneously and has out-of-the-box access to the entire Node.js ecosystem.

To install:

$ brew install lumo
# or
$ npm install -g lumo-cljs
You can’t perform that action at this time.