Skip to content

Instantly share code, notes, and snippets.

@Cyrik
Cyrik / cljfx.ext.web-view.clj
Last active December 3, 2021 09:35
reveal webview javascript <-> clojure interop
(ns cljfx.ext.web-view
(:require [cljfx.lifecycle :as lifecycle]
[cljfx.prop :as prop]
[cljfx.mutator :as mutator]
[cljfx.coerce :as coerce])
(:import [javafx.scene.web WebView]
[javafx.util Callback]))
(defn- coerce-content [x]
(cond
@Cyrik
Cyrik / spec.json
Created November 23, 2021 19:29
Vega spec from Tue Nov 23 2021
{
"autosize": {"type": "fit", "resize": false, "contains": "padding"},
"height": 600,
"width": 600,
"background": "#2e3440",
"scales": [
{
"name": "color",
"type": "ordinal",
"domain": {
@Cyrik
Cyrik / gist:2424582
Created April 19, 2012 22:18
clojure recur stackoverflow
(defn atest [state]
(when-not (and (= "" state) (not (= (first state) \a)))
(list (first state) (. state (substring 1)))))
(defn op [state]
(when-not (and (= "" state) (not (= (first state) \a)))
(list #(list :| %1 %2) (. state (substring 1)))))
(defn chainl1-helper [x p op]
(fn [state]
(loop [x x
state state]