Skip to content

Instantly share code, notes, and snippets.

(ns hoplonfx.demo.app
(:require
[hoplonfx.ui :as ui]
[hoplonfx.cell :refer :all])
(:refer hoplonfx.ui :rename {cell fxcell})
(:import [javafx.geometry Insets Pos]
[com.jfoenix.controls JFXButton]))
(defn jfx-button
[& args]
package hoplonfx;
import java.util.List;
import java.util.HashSet;
import java.util.ArrayList;
import java.lang.ref.WeakReference;
import clojure.java.api.Clojure;
import clojure.lang.IFn;
import clojure.lang.IRef;
import clojure.lang.ISeq;
(ns hoplonfx.ui
(:require
[clojure.data :as data]
[hoplonfx.util :refer :all]
[hoplonfx.cell :as c :refer [cell? formula]]
[camel-snake-kebab.core :refer [->camelCaseString]]
[hoplonfx.codegen :refer [define-javafx-methods
define-javafx-constructors]])
(:import
[javafx.event EventHandler]
(ns hoplonfx.codegen
(:import
[java.lang.reflect Modifier])
(:require
;; Using require/refer below to avoid the runtime dependency.
#_[compliment.utils :as compliment]
[clojure.set :refer [intersection]]
[camel-snake-kebab.core :refer [->kebab-case-string]]
[hoplonfx.util :refer [apply-constructor gensyms conxt with-let]]))
(ns hoplonfx.core
(:require
[hoplonfx.ui :refer [run]]
[hoplonfx.util :refer :all])
(:import
[hoplonfx ApplicationShim]
[javafx.application Application]))
(defonce stage
(delay
@micha
micha / core.clj
Last active January 2, 2019 17:04
(ns hoplonfx.core
(:require
[hoplonfx.ui :refer [run]]
[hoplonfx.util :refer :all])
(:import
[hoplonfx ApplicationShim]
[javafx.application Application]))
(defonce stage
(delay
(ns fjorm.http
(:require
[cheshire.core :as json]))
(defmacro with-open-> [stream & body]
`(with-open [stream# ~stream]
(-> stream# ~@(map #(if (seq? %) % (list %)) body))))
(defn post-json [url json]
(let [bytes (.getBytes (json/generate-string json))]
#!/usr/bin/env bash
abort() { exec 1>&2 ; [[ $1 ]] && echo "$(basename $0): $1" ; exit 1 ; }
usage() {
local prog=$(basename $0)
exec 1>&2
[[ $1 ]] && echo "$prog: $1" && echo
cat <<EOT
USAGE:
from mitmproxy import http
from mitmproxy import ctx
import sys
import re
from urllib.request import Request, urlopen
from urllib.parse import urlparse, urlunparse, parse_qsl, urlencode
class ProxyImpl:
def __init__(self, config):
self.config = config
@micha
micha / core.cljs
Last active November 30, 2017 16:27
Hoplon drag-n-drop demo.
(ns dnd.core
(:require
[hoplon.core :as h :refer [defelem on!]]
[javelin.core :as j :refer [with-let cell cell= deref*]]))
(declare end!)
(defn start!
"Start dragging the item at position <pos>."
[this pos]