I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
(ns crux-pull | |
(:require | |
[edn-query-language.core :as eql] | |
[crux.api :as crux] | |
[my-app.crux-node :refer [crux-node]])) | |
(defn entity | |
([entity-id] (entity crux-node entity-id)) | |
([crux-node entity-id] | |
(crux/entity (crux/db crux-node) entity-id))) |
;; inspired by: https://clojuredocs.org/clojure.zip/zipper#example-54d91161e4b081e022073c72 | |
(defn map-zipper | |
[m ref-keys] | |
{:pre [(set? ref-keys)]} | |
(z/zipper | |
(fn is-branch? [x] | |
(let [ret | |
(cond | |
(not (coll? x)) |
On the evening of May 21st I went along to the eXtreme Tuesday Club (XTC), where my colleague, Andy Parker, ran a session on a model of software engineering called “Reconciling Perspectives”. I work remotely from Bristol, but I regularly visit my companies London offices to catch up with colleagues in person and it's also nice to take the opportunity to go to interesting London based techie meetups, like this one, in the evening.
The model, as I understood it, describes the essential social dynamics and communications that happen between the participants in a successful software development project. So rather than being prescriptive, a process that could be followed to build better software, it was descriptive, identifying the core activities that occur in such successful projects.
The model says software development is about “getting a job done”, which necessitate
-- ## Kematzy Hasura AuditTrail | |
-- This is based on the [Hasura/audit-trigger](https://github.com/hasura/audit-trigger). | |
-- | |
-- Changes from the Hasura version: | |
-- 1. Simplified audit table schema with these changes: | |
-- a. Renamed columns to lowerFirst format. | |
-- b. Changed order of columns. | |
-- c. Combined schema & table name into one column. | |
-- d. Stores the record `id` UUID value in the `rowId` column. |
(ns kc.datomic | |
"Datomic utility functions | |
Usage Notes: | |
Some functions in this namespace take sequences of facts and return them modified in some way. Some up-front modifications are useful for those functions, like replacing all map-form facts with vector-form facts. In order to avoid doing these modifications repeatedly to same the same set of facts (which would be harmless but wasteful), two versions of these functions exist: a \"safe\" version that does those up-front modifications, and an \"unsafe\" version that expects those modifications to already have been performed. The unsafe versions are named like the safe ones, but with a single quote appended. | |
TODO: | |
- consider implementing all fns that branch based on operation as multimethods | |
These fns mostly support :db/add, :db/retract :db.fn/retractEntity, :db.fn/cas, |
;; RGA | |
;; https://speakerdeck.com/ept/data-structures-as-queries-expressing-crdts-using-datalog?slide=22 | |
(def schema | |
{:id/node {:db/valueType :Number} | |
:id/ctr {:db/valueType :Number} | |
:insert/id {:db/valueType :Eid} | |
:insert/parent {:db/valueType :Eid} | |
:assign/id {:db/valueType :Eid} | |
:assign/elem {:db/valueType :Eid} |
;; LWW Register | |
;; https://speakerdeck.com/ept/data-structures-as-queries-expressing-crdts-using-datalog?slide=15 | |
(def schema | |
{:assign/time {:db/valueType :Number} | |
:assign/key {:db/valueType :Number} | |
:assign/value {:db/valueType :Number}}) | |
(def rules | |
'[[(older ?t1 ?key) |
(defn relate [& pairs] | |
(assert (even? (count pairs)) "relate requires an even number of arguments") | |
(->> pairs | |
(partition 2) | |
(map (fn [[k vs]] (map #(hash-map k %) vs))) | |
(apply map merge))) | |
(defn matches-specmap? [specmap m] | |
(reduce-kv |
(try-load-and-configure-library | |
'org-install | |
(setq org-hide-leading-stars t) | |
(setq org-pretty-entities t) | |
(setq org-pretty-entities-include-sub-superscripts nil) | |
(setq org-return-follows-link t) | |
(setq org-special-ctrl-a/e t) | |
(setq org-log-done t) |