Skip to content

Instantly share code, notes, and snippets.

View bostonaholic's full-sized avatar
🏕️

Matthew Boston bostonaholic

🏕️
View GitHub Profile
@bostonaholic
bostonaholic / Kafka-ADR.md
Last active January 13, 2023 16:49
I asked ChatGPT: "Write an Architecture Decision Record for choosing Kafka as an event-driven streaming platform"

Architecture Decision Record (ADR)

Title: Choosing Kafka as an Event-Driven Streaming Platform

Context:

Our system needs to handle high-throughput and low-latency data streams from multiple sources, and provide real-time processing and analytics capabilities. We need to choose a suitable event-driven streaming platform that can handle this workload and integrate with other systems in our architecture.

Decision:

We will use Apache Kafka as our event-driven streaming platform.

I am attesting that this GitHub handle bostonaholic is linked to the Tezos account tz1fPZ5sL92KuvaQfBfAs7mJ8SEgi3ttgiHP for tzprofiles
sig:edsigtpv2K4cVz4mAEChH8HYGFCn87aJ2tYYXHMCMaHYdUJ9vyRnqg7vi6eryigujzohuHDQjTCy2GNf6TFqnKwMZ8GRRd3ZyL7
@bostonaholic
bostonaholic / Gemfile
Last active August 8, 2020 20:44
bundle update doesn't update all outdated deps
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '2.7.1'
gem 'builder'
gem 'kramdown'
gem 'middleman'
gem 'middleman-autoprefixer'
(defn- untrace [v]
(alter-var-root v (fn [new]
(if-let [untraced (:trace/untraced (meta new))]
untraced
(throw (Exception. "Wasn't traced."))))))
(defn- maybe-disable [state n]
(if (< (:calls state) n)
(update-in state [:calls] inc)
(assoc state :done true)))
@bostonaholic
bostonaholic / scratch.clj
Created January 10, 2019 18:15
conforming `s/or` clojure specs
user=> (s/def ::name string?)
:user/name
user=> (s/def ::id int?)
:user/id
user=> (s/conform ::name "bob ross")
"bob ross"
user=> (s/conform ::id 42)
42
user=> (s/def ::name-or-id (s/or ::name2 string? ::id2 int?))
:user/name-or-id
@bostonaholic
bostonaholic / comments.rb
Last active October 22, 2018 15:43
Ruby comments in multiline chaining
select(...)
.where(...)
.group(...)
.order(...)
# can't comment a line in a chain
select(...)
# .where(...)
.group(...)
.order(...)
@bostonaholic
bostonaholic / gist:d0e9daba07a8fed1242169b7318152ca
Last active October 22, 2018 15:43
Blockstack ID verification
Verifying that "bostonaholic.id" is my Blockstack ID. https://onename.com/bostonaholic
@bostonaholic
bostonaholic / transducers.clj
Last active May 10, 2017 17:50
Transducers in a nut-shell
;; From tbaldridge on Slack
(defn map [f coll]
(reduce (fn [acc i]
(conj acc (f i)))
[]
coll))
(map inc [1 2 3]) ;;=> [2 3 4]
@bostonaholic
bostonaholic / and_thread.clj
Last active October 22, 2018 15:46
Clojure and-> and or-> macros
(defmacro and->
"(and-> 1 int? odd?)
;;=> (and (int? 1) (odd? 1))"
[expr & tests]
`(and ~@(for [t# tests]
`(~t# ~expr))))
(defmacro and-> [x & forms] ;; 1, (int? odd?)
user=> (defn hello [] "hello")
#'user/hello
user=> (defn goodbye [] "goodbye")
#'user/goodbye
user=> (let [f hello]
         (with-redefs [hello goodbye]
           (f)))
"hello"
user=&gt; (with-redefs [hello goodbye]