Skip to content

Instantly share code, notes, and snippets.

thosmos / broadbrim.datomic.api.cljc
Created Dec 16, 2015 — forked from domkm/broadbrim.datomic.api.cljc
Datomic EntityMap wrapper for DataScript consistency
View broadbrim.datomic.api.cljc
;;;; Entity wrapper
#?(:clj (declare ->EntityMap))
#?(:clj (deftype EntityMap [^datomic.query.EntityMap entity ^boolean ident?]
(hashCode [this]
(.hashCode entity))
(equals [this o]
(and (instance? (class this) o)
(.equals entity (.entity o))))
View router.cljs
(def views
{:some-view SomeView
:another-view AnotherView})
(def factories
(map om/factory (vals views)))
(defui Router
static om/Ident
(ident [this {:keys [route]}]
thosmos / core.cljs
Last active Nov 11, 2015
Om Next Ident + IKey
View core.cljs
(ns om-tutorial.core
(:require [goog.dom :as gdom]
[ :as om :refer-macros [defui]]
[om.dom :as dom]
[cljs.pprint :as pprint]))
(def conn
thosmos / mock-connection.clj
Created Oct 21, 2015 — forked from vvvvalvalval/mock-connection.clj
Mocking datomic.Connection for fast in-memory testing
View mock-connection.clj
(ns bs.utils.mock-connection
"Utilities for using Datomic"
(:require [datomic.api :as d])
(:use clojure.repl clojure.pprint)
(:import (java.util.concurrent BlockingQueue LinkedBlockingDeque)
(datomic Connection)))
(defrecord MockConnection
[dbAtom, ^BlockingQueue txQueue]
thosmos / components.cljs
Last active Aug 29, 2015
Imagining atomatizing the App
View components.cljs
;; see blog post here:
{ :ns "hmmm.core"
:require ["om.core :as om :include-macros true"
"om.dom :as dom :include-macros true"]
:app {
:root [:app-state :app-def {:elementId "content"}]
View designer.html
<link href="../core-scaffold/core-scaffold.html" rel="import">
<link href="../core-header-panel/core-header-panel.html" rel="import">
<link href="../core-menu/core-menu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../paper-button/paper-button.html" rel="import">
<link href="../paper-checkbox/paper-checkbox.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
print "Hello, Geometry Zen!"