This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn piece-view [data owner] | |
(let [[_ row] (om/path data)] | |
(reify | |
om/IRender | |
(render [_] | |
(dom/div nil row))))) | |
(defn board-view [app owner] | |
(let [size 40] | |
(reify | |
om/IRender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my-app.core | |
(:require [goog.object :as gobj])) | |
(defn js-obj->clj-map | |
"Uses the Google Closure object module to get the keys and values of any JavaScript Object | |
and put them into a ClojureScript map" | |
[obj] | |
(zipmap (gobj/getKeys obj) (gobj/getValues obj))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.test.check.random :as tcr]) | |
; Long tests taken from Google Closure Libraries Long tests | |
; https://github.com/google/closure-library/blob/master/closure/goog/math/long_test.js | |
(def TEST_BITS | |
#js [ | |
0x80000000, 0x00000000, 0xb776d5f5, 0x5634e2db, 0xffefffff, 0xffffffff, | |
0xfff00000, 0x00000000, 0xfffeffff, 0xffffffff, 0xffff0000, 0x00000000, | |
0xfffffffe, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xfeffffff, | |
0xffffffff, 0xff000000, 0xffffffff, 0xfffeffff, 0xffffffff, 0xffff0000, | |
0xffffffff, 0xffff7fff, 0xffffffff, 0xffff8000, 0xffffffff, 0xfffffffe, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.test.check.random :as tr]) | |
(simple-benchmark [sr (tr/next-rng) times 2000] | |
(->> (iterate #(first (tr/split %)) sr) | |
(take times) | |
(map tr/rand-long) | |
doall) | |
100) |