- Distributed Systems Concepts and Design (5th Edition) (http://skec.ac.in/ebooks/George-Coulouris-Distributed-Systems-Concepts-and-Design-5th-Edition.pdf)
- Distributed Algorithms: An Intuitive Approach (http://www.amazon.com/Distributed-Algorithms-An-Intuitive-Approach/dp/0262026775/)
- Programming Distributed Computing Systems: A Foundational Approach (http://www.amazon.com/Programming-Distributed-Computing-Systems-Foundational/dp/0262018985/)
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
;; Call the renderer-fn macro with a template and it returns a function optimized to render it. | |
;; This happens at compile-time. | |
;; At run-time, you call this function with the parameters that will be interpolated into the template, | |
;; typically (but not limited to) a map. | |
;; | |
;; Useful in i18n for variable interpolation, for example. I'm using this to add internationalization | |
;; support to https://github.com/xavi/noir-auth-app | |
;; See usage at the end. |
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 favila.datomic-util.restore-datoms | |
"A \"manual\" datomic database restore. | |
Writes raw datoms (stored in a stream written by d/datoms) to an empty database. | |
Useful for memory databases: you can write out all the datoms in it, then read | |
them into another database. (Note mem dbs have no log or retractions)." | |
(:require [datomic.api :as d] | |
[clojure.edn :as edn])) | |
(defrecord datom [e a v tx added?]) |
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
# generate a new flake ID | |
SELECT ((FLOOR((UNIX_TIMESTAMP(NOW(3)) - 946702800) * 1000)) << 23) | ROUND((RAND() * 4194303)); | |
# replace auto increment IDs with flake IDs based on updateAt column | |
UPDATE ids SET id = (SELECT ((FLOOR(((ids.createdAt + 0.000) - 946702800) * 1000)) << 23) | ROUND((RAND() * 4194303))); |
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 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))) |
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 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))) |
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 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))) |
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
(use '[datomic.api :only [q db] :as d]) | |
(def uri "datomic:mem://accounts") | |
;; create database | |
(d/create-database uri) | |
;; connect to database | |
(def conn (d/connect uri)) |
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 storm.starter.clj.word-count-kafka | |
(:import ;[backtype.storm StormSubmitter LocalCluster] | |
[storm.kafka KafkaConfig HostPort KafkaSpout SpoutConfig StringScheme]) | |
(:use [backtype.storm clojure config]) | |
(:gen-class)) | |
(def ^{:private true} | |
host (list "localhost:9092")) | |
(def ^{:private true |