Skip to content

Instantly share code, notes, and snippets.

@cpetzold
cpetzold / SketchSystems.spec
Created May 13, 2020 17:35
Seller Org Onboarding
Seller Org Onboarding
create account -> Account Created
delete account -> Account Deleted
Account Created
submit application -> Applied
Account Deleted
Applied
admin approve -> Approved
admin reject -> Rejected
Approved
(defmacro fnk-> [bindings & body]
`(fn [x# y#]
(letk [~bindings #y]
(-> x# ~@body))))
(defmacro fnk->> [bindings & body]
`(fn [x# y#]
(letk [~bindings #y]
(->> x# ~@body))))
(ns ring-node.core
(:require
[clojure.string :as str]
[cljs.nodejs :as nodejs]))
(def http (nodejs/require "http"))
(def url (nodejs/require "url"))
(defn- build-request-map
"Create the request map from the ServerRequest object."
(deftheme prismatic "Always interesting!")
(let ((prismatic-gray-darkest "#141411")
(prismatic-gray-darker "#202026")
(prismatic-gray-dark "#666666")
(prismatic-gray "#a2a6a6")
(prismatic-gray-light "#bfbfbf")
(prismatic-gray-lighter "#e5e5e5")
(prismatic-gray-lightest "#f2f2f2")
(deftype Cursor [a ks meta validator]
IEquiv
(-equiv [o other] (identical? o other))
IDeref
(-deref [this] (get-in @a ks))
IReset
(-reset! [this new-value]
(when-not (nil? validator)
function toke
set_color green
echo ' dM'
echo ' MMr'
echo ' 4MMML .'
echo ' MMMMM. xf'
echo ' . "M6MMM .MM-'
echo ' Mh.. +MM5MMM .MMMM'
echo ' .MMM. .MMMMML. MMMMMh'
echo ' )MMMh. MM5MMM MMMMMMM'
(defn selector [data]
(cond
(or (string? data) (keyword? data)) (name data)
(coll? data) (clojure.string/join " " (map selector data))))
(defmacro sel
([data]
`(sel ~data js/document))
([data base]
`(.querySelector ~base ~(selector data))))
(ns webapp.client.test.newsfeed-test
(:require [webapp.client.utils :as utils]))
(defn wait-for-event [event timeout callback]
(let [timeout-id (.setTimeout js/window #(callback false) timeout)]
(.on (js/$ js/window) event
(fn [_ res]
(callback res)
(.clearTimeout js/window timeout-id)))))
(def initial-state
{:mode :search
:input ""
:completes []})
(def state (atom initial-state))
(def mode-map
{:search
{:placeholder "Search..."
function promise() {
var finished = false,
result = null,
waiters = [];
return {
fulfil: function(res) {
finished = true;
result = res;
forEach(waiters, function(cb) {
cb(result);