Skip to content

Instantly share code, notes, and snippets.

;; Remember to (:import goog.Uri) in your ns declaration
;; Example input/output:
;; http://localhost:10555/?model=duck&manual-tick=false&collapse-all=true&capture-first-frame=true&skybox-name=sky1.png&age=30&money=300.30
;; => {:model "duck",
;; :tick-first-frame? false,
;; :manual-tick? false,
;; :collapse-all? true,
;; :capture-first-frame? true,
;; :skybox-name ["sky1" "png"],
;; :age 30,
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
(ns om-data.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[datascript :as d]))
(enable-console-print!)
(def schema {})
(def conn (d/create-conn schema))
// C++11 style observer pattern implementation using lambda for scoped
// connection management.
//
// Copyright (c) 2012 Nick C.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@kahunamoore
kahunamoore / gist:a54a8c030167c5bd669f
Created January 23, 2015 02:02
C++ Generic Initializer List
// from: http://stackoverflow.com/questions/15848781/constructor-for-nested-initializer-lists
template <int d, typename T>
class ClassA {
size_t n_[d] = {0};
T* data_;
template <int D, typename U>
struct Initializer_list {
@kahunamoore
kahunamoore / console.txt
Created January 15, 2014 06:33
Odd rule binding behavior
v: c ?e1: ?e2: puzzle.core.Entry@ebe1e4be
v: c ?e1: ?e2: puzzle.core.Entry@ebe1e4be
v: c ?e1: ?e2: puzzle.core.Entry@ebe1e4be
v: c ?e1: ?e2: puzzle.core.Entry@ebe1e4be
v: b ?e1: ?e2: puzzle.core.Entry@ebe1e4bf
v: a ?e1: ?e2: puzzle.core.Entry@ebe1e4bc