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 viebel.a8a0349b00689c40571b0faaa36a9ae8.raw.foo) | |
(defn square [x] (* x x)) |
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 viebel.62563c3ad1a09e2fcabe9482972f2ee0.raw.bar | |
(:require [viebel.a8a0349b00689c40571b0faaa36a9ae8.raw.foo :refer [square]])) | |
(defn square-square [x] (square (square x))) |
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
cljs.user=> (ns my.ns$macros) | |
nil | |
my.ns$macros=> (defmacro hello[x] x) | |
true | |
my.ns$macros=> (my.ns/hello 19) | |
19 |
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
cljs.user=> (ns my.ns$macros) | |
nil | |
my.ns$macros=> (defmacro hello[x] x) | |
true | |
my.ns$macros=> (my.ns/hello 19) | |
19 |
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
cljs.user=> (ns my.ns$macros) | |
nil | |
my.ns$macros=> (defmacro hello[x] x) | |
true | |
my.ns$macros=> (my.ns/hello 19) | |
19 |
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 viebel.gist-57d9ebad3381e727c2f0a373e1bd4eec.raw.spec-example | |
(:require [cljs.spec :as s])) | |
(s/def ::tag (s/cat :type #{:div} | |
:attrs map? | |
:children (s/spec (s/* ::tag)))) | |
(s/explain ::tag [:div {} [[:div {} []]]]) | |
;; In: [2 0] val: [:div {} []] fails spec: _ at: [:children :type] predicate: #{:div} |
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 om.next.spec | |
(:require [cljs.spec :as s])) | |
(s/def ::ident (s/and vector? (s/cat :ident keyword? :value #(not (coll? %))))) | |
(s/def ::join-key (s/or :prop keyword? :ident ::ident)) | |
(s/def ::join (s/and (s/map-of ::join-key ::query) #(= (count %) 1))) | |
(s/def ::union (s/and (s/map-of keyword? ::query) #(> (count %) 1))) | |
(s/def ::param-expr | |
(s/cat :query-expr ::query-expr |
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
(extend-type object | |
ILookup | |
(-lookup | |
([this k] | |
(-lookup this k nil)) | |
([this k not-found] | |
(let [k (name k)] | |
(if (.hasOwnProperty this k) | |
(aget this k) | |
not-found))))) |
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 viebel.color-loop | |
(:require-macros | |
[cljs.core.async.macros :refer [go-loop]]) | |
(:require | |
[cljs.core.async :refer [timeout <!]] | |
[viebel.gist-3800b8ebae5292921c7d6fcb6c995c1f.raw.body-color :refer [set-bg-color]])) | |
(def colors ["red" "yellow" "magenta" "blue" "green"]) | |
(go-loop [] | |
(set-bg-color (rand-nth colors)) |
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 set-bg-color [c] | |
(set! (.. js/document -body -style -backgroundColor) c)) | |
(set-bg-color "green") |