Skip to content

Instantly share code, notes, and snippets.

@bostonou
bostonou / SketchSystems.spec
Created January 24, 2024 21:31
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second States
Second States
LOS
Submitted*
application-verified -> Verified
documents-requested -> Waiting Docs
Waiting Docs
docs-received -> Verified
docs-overdue -> Email Notification Sent
Email Notification Sent
docs-received -> Verified
docs-overdue -> Email Notification Sent
LOS
Submitted*
application-verified -> Verified
documents-requested -> Waiting Docs
Waiting Docs
docs-received -> Verified
docs-overdue -> Email Notification Sent
Email Notification Sent
docs-received -> Verified
docs-overdue -> Email Notification Sent
LOS
Submitted*
application-verified -> Verified
documents-requested -> Waiting Docs
Waiting Docs
docs-received -> Verified
docs-overdue -> Email Notification Sent
Email Notification Sent
docs-received -> Verified
docs-overdue -> Email Notification Sent
@bostonou
bostonou / real-world-core-async.cljs
Created January 11, 2019 20:08
clojurescriptmadeeasy.com/blog/real-world-core-async.html
(ns cljsmadeeasy.core
(:require [cljs.core.async :as a])
(:require-macros [cljs.core.async.macros :refer [go]]))
(defn fill-load-chan [number-of-pages]
(let [partitions (partition-all NUM-PAGES-PER-LOAD
(range 1 (inc number-of-pages)))
c (a/chan)]
(go
(doseq [page-numbers partitions]
;;examples with no valid matter look up or datomic
(add-matter-review-dbs
nil nil
'[({:a :b} {:review-id "123"
:matter-id "456"
:data "some-data"})
({:c :d} {:review-id "abc"})])
;;=>
[({:a :b}
@bostonou
bostonou / promise.cljs
Created July 14, 2015 01:14
Promise.all with core.async
(ns cljs-made-easy.core
(:refer-clojure :exclude [into])
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [<! >!] :as a]))
(enable-console-print!)
(defn resolving-promise [key t reject]
(go
(pr (str key " starting"))
@bostonou
bostonou / promise-all.cljs
Last active August 29, 2015 14:24
Promise.all with core.async
(ns cljs-made-easy.core
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [<! >!] :as a]))
(enable-console-print!)
(defn good-go-block [k t ctrl]
(go
(<! (a/timeout t))
(str k " waited " t "ms")))
@bostonou
bostonou / line-seq.cljs
Last active October 21, 2018 20:54
line-seq in cljs
;; This is a macro, and must be in clojure. It's name and location is the same as
;; the cljs file, except with a .clj extension.
(ns cljs-made-easy.line-seq
(:refer-clojure :exclude [with-open]))
(defmacro with-open [bindings & body]
(assert (= 2 (count bindings)) "Incorrect with-open bindings")
`(let ~bindings
(try
(do ~@body)
@bostonou
bostonou / cljs-line-reader.cljs
Last active August 29, 2015 14:21
Line by line reader in cljs
(ns cljs-line-reader.core
(:refer-clojure :exclude [flush])
(:require clojure.string
[cljs.core.async :refer [>!]])
(:require-macros [cljs.core.async.macros :refer [go]]))
(def fs (js/require "fs"))
(def stream (js/require "stream"))
(def ^:const eol (.-EOL (js/require "os"))) ;;eg "\n" or "\r\n"