-
keystore data, w/o the tradeoffs of other nosql databases
-
ACID tx, joins, datalog, simple schema
-
"Facts dont change when you incorporate time"
- SQL db in past, CRUD triggers, history tables
(ns people | |
(:use [clojure.string :only (join)] | |
[clojure.pprint :only (pprint simple-dispatch)])) | |
;; we can make maps using the special literal form: | |
{:a 100 | |
:b 200} | |
(class {:a 100 :b 200}) |
{-# LANGUAGE GADTs, Rank2Types, KindSignatures, ScopedTypeVariables, TypeOperators, DataKinds, PolyKinds, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, DoRec, ExtendedDefaultRules #-} | |
import Control.Applicative | |
import Control.Category | |
import Control.Comonad | |
import Control.Monad.Fix | |
import Control.Monad (ap) | |
import Data.Functor.Identity | |
import Data.Typeable | |
import Data.Monoid | |
import Data.Unique |
(ns n01se.externs-for-cljs | |
(:require [clojure.java.io :as io] | |
[cljs.compiler :as comp] | |
[cljs.analyzer :as ana])) | |
(defn read-file [file] | |
(let [eof (Object.)] | |
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))] | |
(vec (take-while #(not= % eof) | |
(repeatedly #(read stream false eof))))))) |
(defn debounce | |
([c ms] (debounce (chan) c ms)) | |
([c' c ms] | |
(go | |
(loop [start nil loc (<! c)] | |
(if (nil? start) | |
(do | |
(>! c' loc) | |
(recur (js/Date.) nil)) | |
(let [loc (<! c)] |
(ns blog.errors.core | |
(:require-macros | |
[cljs.core.async.macros :refer [go]] | |
[blog.utils.macros :refer [<?]]) | |
(:require | |
[cljs.core.async :refer [>! <! chan close!]])) | |
;; convert Node.js async function into a something | |
;; that returns a value or error on a channel | |
(defn run-task [f & args] |
## Using Emacs CIDER as the Figwheel REPL tool | |
project.clj should have this line: | |
``` | |
:figwheel { :nrepl-port 7888 } | |
``` | |
At the defproject-level. | |
It enables external tools to connect to the Figwheel REPL. To connect |
;; | |
;; Example usages at the bottom of the file | |
;; | |
(defn productions | |
"Returns a sequence of values by repeatedly calling `produce!` until it | |
returns `fin`. The sequence can be used lazily/caching or reducible/non-caching. | |
The arity-2 variant's `produce!` takes no arguments and returns a value | |
or the terminator. |
(ns maps.core) | |
;; In Clojure you can fetch items from a map three different ways. Which should | |
;; you use when? | |
(= "bar" ({:foo "bar"} :foo)) ; map as function | |
(= "bar" (:foo {:foo "bar"})) ; key as function | |
(= "bar" (get {:foo "bar"} :foo)) ; `get` as function | |
;; <INCIDENTALLY> |
(ns typehint.core) | |
;; A little type hint hint... | |
(set! *warn-on-reflection* true) | |
;; There are two ways to type hint the return value of a function, but one is | |
;; (technically) wrong: | |
(defn ^String as-string0 |