Skip to content

Instantly share code, notes, and snippets.

View main.py
# main.py
print "Hello, Geometry Zen!"
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">
@thosmos
thosmos / components.cljs
Last active Aug 29, 2015
Imagining atomatizing the App
View components.cljs
;; see blog post here: http://code.thosmos.com/om/clojurescript/2014/12/15/imagining-atomatizing-the-app.html
{ :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"}]
@thosmos
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
thosmos / core.cljs
Last active Nov 11, 2015
Om Next Ident + IKey
View core.cljs
(ns om-tutorial.core
(:require [goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[cljs.pprint :as pprint]))
(enable-console-print!)
(def conn
(d/create-conn
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
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?]
Object
(hashCode [this]
(.hashCode entity))
(equals [this o]
(and (instance? (class this) o)
(.equals entity (.entity o))))
@thosmos
thosmos / cljs_perf.core.cljs
Created Oct 21, 2016
js->clj using transients
View cljs_perf.core.cljs
(ns cljs_perf.core
(:require [goog.object :as gobject]))
(let [data
"[{ \"web-app\": { \"servlet\": [ { \"servlet-name\": \"cofaxCDS\", \"servlet-class\": \"org.cofax.cds.CDSServlet\", \"init-param\": { \"configGlossary:installationAt\": \"Philadelphia, PA\", \"configGlossary:adminEmail\": \"ksm@pobox.com\", \"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\", \"logMaxSize\": \"\", \"dataLog\": 1, \"dataLogLocation\": \"/usr/local/tomcat/logs/dataL
@thosmos
thosmos / cljs-perf.core
Created Nov 20, 2017
js->clj using transients
View cljs-perf.core
(ns cljs_perf.core
(:require [goog.object :as gobject]))
(def data "[\n {\n \"_id\": \"5a1313dbcb701efd98a8e0e0\",\n \"index\": 0,\n \"guid\": \"e2e397fb-8d26-48e0-82a9-6a66433fa2ac\",\n \"isActive\": false,\n \"balance\": \"$1,369.60\",\n \"picture\": \"http://placehold.it/32x32\",\n \"age\": 35,\n \"eyeColor\": \"green\",\n \"name\": \"Duran Bond\",\n \"gender\": \"male\",\n \"company\": \"SPRINGBEE\",\n \"email\": \"duranbond@springbee.com\",\n \"phone\": \"+1 (881) 448-3188\",\n \"address\": \"189 Centre Street, Nicholson, New Mexico, 5961\",\n \"about\": \"Excepteur eu incididunt qui fugiat proident. Ut voluptate elit anim mollit aliqua elit in ut aliqua. Anim ad nisi consequat incididunt aute sunt consectetur labore ipsum deserunt proident. Est nisi est adipisicing ea anim id excepteur aliqua fugiat. Sunt ex cillum officia Lorem laboris. Consequat qui qui anim do minim adipisicing laboris Lorem irure reprehenderit duis veniam minim. Non quis tempor esse a
@thosmos
thosmos / firebase-firestore-externs.js
Created May 21, 2018
Externs for Google Firebase's Firestore
View firebase-firestore-externs.js
firebase.firestore = function(app) {};
firebase.app.App.prototype.firestore = function(app) {};
firebase.firestore.Firestore = function() {};
firebase.firestore.Firestore = {};
firebase.firestore.Firestore.app;
firebase.firestore.Firestore.DocumentData;
firebase.firestore.Firestore.setLogLevel = function(logLevel) {};
firebase.firestore.Firestore.prototype.batch = function () {};
firebase.firestore.Firestore.prototype.collection = function (collectionPath) {};