-
These notes accompany a talk I gave on the 19th of April at ScaleConf 2013.
-
Slides: https://speakerdeck.com/robertstuttaford/cognicians-new-architecture-with-clojure-and-datomic
-
These notes accompany a talk I gave on the 15th of May at the Computer Science Dept of UCT.
-
Slides: https://speakerdeck.com/robertstuttaford/functional-programming-star-isnt-star-scary
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
(def conn (d/conn some-uri)) | |
(def some-id 12345) | |
(defn get-v [db] (ffirst (d/q '[:find ?v :in $ ?e :where [?e :some/attribute ?v]] db some-id))) | |
(get-v (d/db conn)) | |
;; => :some-value | |
(def tx [[:db/retract some-id :some/attribute :some-value] |
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 start-session! | |
[] | |
;; put-value! talks to ring's sessions dsl | |
(put-value! :session-uuid (db/new-uuid))) | |
(defn uuid | |
[] | |
;; get-value talks to ring's sessions dsl | |
(get-value :session-uuid)) |
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
Check out README.md to get started editing Clojure with Emacs. |
-
These notes accompany a talk I gave on the 9th of October at Tech4Africa 2013.
-
Twitter: @RobStuttaford
These notes accompany a talk I gave on the 6th of February at RubyFuza 2014.
- Twitter: @RobStuttaford
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 app | |
(:require [om.core :as om :include-macros true])) | |
(defn log-tx [tx-data root-cursor] | |
(let [{:keys [path old-value new-value]} tx-data | |
c js/console] | |
(doto c (.group (str "TRANSACTION " path)) (.groupCollapsed "OLD")) | |
(prn (pr-str old-value)) | |
(doto c (.groupEnd) (.group "NEW")) | |
(prn (pr-str new-value)) |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Connection | |
(defprotocol DatomicConnection | |
(as-conn [_])) | |
(extend-protocol DatomicConnection | |
datomic.Connection | |
(as-conn [c] c) | |
datomic.db.Db |
OlderNewer