Skip to content

Instantly share code, notes, and snippets.

View ThomasDeutsch's full-sized avatar

Thomas Deutsch ThomasDeutsch

View GitHub Profile
import { Signal, signal } from '@angular/core';
import { Event } from '@flowcards/core';
export function getSignal<P, V>(event: Event<P, V>) {
const eventSignal = signal<Event<P, V>>(event);
event.registerCallback(() => {
eventSignal.set(this._internalEvent);
});
return eventSignal.asReadonly;
}
@ThomasDeutsch
ThomasDeutsch / SketchSystems.spec
Created August 9, 2018 19:54 — forked from ryanlucas/SketchSystems.spec
# Style Buttons: A Parallel State Demo
# Style Buttons: A Parallel State Demo
# 2018 August 06
# By Ryan Lucas (Twitter: @ryanlucas)
Font Style Selector&
Bold
Bold Off
bold clicked -> Bold On
Bold On
bold clicked -> Bold Off
@ThomasDeutsch
ThomasDeutsch / SketchSystems.spec
Created June 22, 2018 09:04
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
;; i used the new-js->clj3 function from Darrick Wiebe
;; https://gist.github.com/pangloss/591d77231fda460c2fbe
;; i have added a :ns parameter
(let [data
"[{ \"web-app\": { \"servlet\": [ { \"servlet-name\": \"cofaxCDS\", \"servlet-class\": \"org.cofax.cds.CDSServlet\", \"init-param\": { \"configGlossary:installationAt\": \"Philadelphia, PA\", \"configGlossary:adminEmail\": \"[email protected]\", \"configGlossary:poweredBy\": \"Cofax\", \"configGlossary:poweredByIcon\": \"/images/cofax.gif\", \"configGlossary:staticPath\": \"/content/static\", \"templateProcessorClass\": \"org.cofax.WysiwygTemplate\", \"templateLoaderClass\": \"org.cofax.FilesTemplateLoader\", \"templatePath\": \"templates\" } }, { \"servlet-name\": \"cofaxAdmin\", \"servlet-class\": \"org.cofax.cds.AdminServlet\" }, { \"servlet-name\": \"cofaxTools\", \"servlet-class\": \"org.cofax.cms.CofaxToolsServlet\", \"init-param\": { \"templatePath\": \"toolstemplates/\", \"log\": 1, \"logLocation\": \"/usr/local/tomcat/logs/CofaxTools.log\", \"lo
(ns scheduler.devcards.omnexttest
(:require
[devcards.core]
[om.next :as om :refer-macros [defui ui]]
[om.dom :as dom :include-macros true])
(:require-macros
[devcards.core :as dc :refer [defcard defcard-doc defcard-om-next noframe-doc deftest dom-node]]))
(defcard-doc
"## Navigation with Toggle
@ThomasDeutsch
ThomasDeutsch / core.cljs
Last active November 26, 2015 11:14
why is the reader called twice, after the query params get modified?
(defmulti read om/dispatch)
(defmethod read :input-handler
[{:keys [query state]} k {:keys [query]}]
(println "read: input-handler")
(let [st @state]
{:value {:input-handler (clojure.string/join [query "+X"]) }}))
(defui SomeInput
(ns om-tutorial.core
(:require
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]))
;; Problem:
;; the search input reader (:search/result) will get called 2 times with each query update.
(ns scheduler.main.core
(:require ;; global
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[datascript.core :as d]
;[sablono.core :as html :refer-macros [html]]
;; scheduler
;[scheduler.devcards.testdata :as testdata]
;[scheduler.main.db :refer [conn mutate read]]
;[scheduler.main.placement :refer [placement Placement]]
(ns om-tutorial.core
(:require
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[datascript.core :as d]
[om.dom :as dom]
[cljs.pprint :as pprint]))
(enable-console-print!)
(ns om-tutorial.core
(:require
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[datascript.core :as d]
[om.dom :as dom]))
(enable-console-print!)
;; -----------------------------------------------------------------------------