https://databass.dev/links/1 -> https://issues.apache.org/jira/browse/CASSANDRA-2494
https://databass.dev/links/2 -> https://github.com/apache/cassandra/blob/7df67eff2d66dba4bed2b4f6aeabf05144d9b057/src/java/org/apache/cassandra/service/reads/repair/RowIteratorMergeListener.java
https://databass.dev/links/3 -> https://github.com/lasp-lang/partisan
https://databass.dev/links/4 -> https://github.com/helium/plumtree
https://databass.dev/links/5 -> https://dev.mysql.com/doc/internals/en/transaction-management.html
https://databass.dev/links/6 -> https://www.postgresql.org/docs/9.3/sql-prepare-transaction.html
https://databass.dev/links/7 -> https://docs.mongodb.com/v3.6/tutorial/perform-two-phase-commits
https://databass.dev/links/8 -> https://fauna.com
https://databass.dev/links/9 -> https://github.com/cockroachdb/cockroach
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 wrap-fn | |
"Wrap or replace some function with your own function" | |
[qualifier wrapper] | |
(alter-var-root | |
qualifier | |
(fn [original-fn] | |
(fn [& caller-arguments] | |
(wrapper caller-arguments original-fn))))) | |
;; Replace your function implementation: |
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 handler | |
[] | |
(println "HANDLER")) | |
(defn wrap-1 | |
[handler] | |
(fn [request] | |
(println 1) | |
(handler request) |
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
data Query = Query | |
data SomeObj = SomeObj | |
data IoOnlyObj = IoOnlyObj | |
data Err = Err | |
-- There's a decoder function that makes some object from String | |
decodeFn :: String -> Either Err SomeObj | |
decodeFn = undefined | |
-- There's a query, that runs against DB and returns array of strings |
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
#!/usr/bin/ruby | |
res = `lein do pom, jar` | |
jar = res.split("\n").last.gsub("Created ", "") | |
puts "Gonna deploy jar: #{jar}" | |
exec "scp pom.xml #{jar} clojars@clojars.org:" |
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
(defmacro my-let | |
[bindings & body] | |
(assert (-> bindings count even?) "Bindings count can only be even.") | |
`((fn [~@(take-nth 2 bindings)] | |
~@body) | |
~@(take-nth 2 (rest bindings)))) |
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 my-test-ns | |
(:require [clojure.test :refer :all]) | |
(:import [java.util.concurrent CountDownLatch TimeUnit]) | |
(defmacro with-latch | |
[countdown-from & body] | |
`(let [latch# (CountDownLatch. ~countdown-from) | |
~'latch latch#] | |
~@body | |
(.await latch# 5 TimeUnit/SECONDS) |
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
;; Writing something remotely reminding nlet | |
(defmacro body-and-bindings | |
[bindings & body] | |
`(let [~(first bindings) 1 | |
~(second bindings) 2] | |
~@body)) | |
;; Expands to: | |
(let* [a 1 b 2] (+ a b)) |
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 ^String head | |
"Returns the first n characters of s." | |
[n ^String s] | |
(if (> (count s) n) | |
s | |
(.substring s (- 0 n)))) |
NewerOlder