Skip to content

Instantly share code, notes, and snippets.

(ns pie-a-la-mode
(:import [java.util.concurrent Executors]))
;; Concurrency example from The Pragmatic Programmers. Waiters check if there's
;; enough pie and ice cream before they sell an order, but if they don't
;; coordinate it's still possible to sell more than we have.
;;
;; The below code should return either :ok or :not-available for a given order.
;; If we oversell, then it will throw an exception.
;;
@thheller
thheller / a.cljs
Last active June 12, 2017 08:40 — forked from tiye/a.cljs
Exploring if I can get Respo component simpler. Tried in Lumo.
(ns demo.a
(:require [demo.b :refer [defcomp]]))
(defcomp my-comp [x y] 1)
(println my-comp)
(ns util.camelize-dasherize
(:import (clojure.lang IPersistentMap Keyword))
(:require [clojure.string :as s]
[clojure.zip :as zip]))
; TODO: regex is slow, should try iterating the string.
(defn dasherize-string*
"Converts an underscored or camelized string
into an dasherized one."
[s]