Skip to content

Instantly share code, notes, and snippets.

Avatar

David Martin DaveWM

View GitHub Profile
View csv-to-kafka.clj
#!/usr/bin/env bb
;; ^^ this tells our shell to use Babashka to run this script
;; read the file path of our CSV and the key field from the command line args
(def csv-file-path (first *command-line-args*))
(def key-field (second *command-line-args*))
;; read the CSV line-by-line into a data structure
(def csv-data
(with-open [reader (io/reader csv-file-path)]
@DaveWM
DaveWM / datomic-update-cardinality-many-attr.clj
Created Nov 21, 2019
Datomic - update cardinality many attr
View datomic-update-cardinality-many-attr.clj
(ns datomic-update-cardinality-many
(:require [datomic.api :as d]))
(defn update-attr-txs [db entity-id attr values]
(let [current-vals (-> (d/q '[:find [?p ...]
:where [?id :intention/parents ?p]
:in $ ?id]
db
entity-id)
(set))
View SketchSystems.spec
Loan
Non-existent
origination -> Payable
Payable
Current
payment time elapses -> Delinquent
full term reached -> End of Term
Delinquent
insufficient payment -> Delinquent
defaulted -> Default
@DaveWM
DaveWM / rollup.config.js
Created Jan 5, 2017
Rollup CommonJS bug
View rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
export default {
entry: 'test.js',
format: 'iife',
moduleName: 'main',
plugins: [
commonjs({
include: 'x.js'
})
You can’t perform that action at this time.