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
import Chart from 'chart.js' | |
import R from 'ramda' | |
view Main { | |
const average = data => data | |
.filter(R.identity) | |
.reduce((sum, datum) => sum + parseInt(datum), 0) | |
/ data.length |
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
import {parse, Source} from 'graphql/language' | |
import {GraphQLSchema, GraphQLObjectType, GraphQLString} from 'graphql/type' | |
import {graphql} from 'graphql' | |
const whisperType = new GraphQLObjectType({ | |
name: 'Whisper', | |
fields: () => ({ | |
whyAreYouWhispering: { | |
type: GraphQLString | |
} |
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
'[:find [?e ...] | |
:where [?e :foo/bar ?bar] | |
(or-join [?bar] | |
[?bar :bar/baz true] | |
[?bar :bar/boop true])] | |
;; java.lang.RuntimeException: Unable to resolve symbol: ?bar in this context, compiling:(NO_SOURCE_PATH:0:0) |
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
java.lang.StackOverflowError | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6651) | |
at clojure.lang.Compiler.analyze(Compiler.java:6445) | |
at clojure.lang.Compiler.analyze(Compiler.java:6406) | |
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3719) | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6646) | |
at clojure.lang.Compiler.analyze(Compiler.java:6445) | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6632) | |
at clojure.lang.Compiler.analyze(Compiler.java:6445) | |
at clojure.lang.Compiler.access$100(Compiler.java:38) |
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
(defmacro if-let-all-each | |
"Like if-let-all but allows for a return case in each binding & only has 1 body." | |
[bindings & body] | |
(let [pairs (partition 3 bindings) | |
names (mapv first pairs) | |
exprs (map second pairs) | |
fail-vals (map #(nth % 2) pairs) | |
exprs-in-if-let (fn self [[name1 & more-names] [expr1 & more-exprs] [val1 & more-vals]] | |
`(if-let [~name1 ~expr1] |
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
java.lang.StringIndexOutOfBoundsException: String index out of range: 0 | |
String.java:686 java.lang.String.charAt | |
Compiler.java:6960 clojure.lang.Compiler.maybeResolveIn | |
core.clj:4026 clojure.core/ns-resolve | |
core.clj:4023 clojure.core/ns-resolve | |
backtick.clj:76 backtick/ns-resolve-sym | |
backtick.clj:94 backtick/resolve-symbol | |
backtick.clj:87 backtick/resolve-symbol | |
backtick.clj:87 backtick/resolve-symbol | |
backtick.clj:87 backtick/resolve-symbol |
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
{ | |
"paths": { | |
"/hello": { | |
"get": { | |
"responses": { | |
"200": { | |
"schema": { | |
"$ref": "#/definitions/Message" | |
}, | |
"description": "" |
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 emap-to-hash-map [e] | |
(cond | |
(or | |
(-> e class .toString (clojure.string/split #" ") second (= "datomic.query.EntityMap")) | |
(map? e)) (reduce-kv (fn [m k v] (assoc m k (emap-to-hash-map v))) {} (into {} e)) | |
(coll? e) (map emap-to-hash-map e) | |
:else e)) |
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
(d/transact | |
datomic | |
[{:db/id #db/id [:db.part/tx] | |
:db/txInstant #inst "2011-01-01"} | |
{:db/id #db/id [:db.part/db] | |
:db/ident :test/str | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one |
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
user=> (def h "hello") | |
#'user/h | |
user=> h | |
"hello" | |
user=> 'h | |
h | |
user=> (+ 1 2) | |
3 | |
user=> '(+ 1 2) |
NewerOlder