Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| {:min-bb-version "0.6.1" | |
| :tasks | |
| {:requires ([babashka.fs :as fs] | |
| [babashka.process :as proc] | |
| [clojure.string :as str] | |
| [clojure.pprint :as pprint]) | |
| ;; Helpers | |
Chaining promises in ClojureScript is best done using the thread-first macro, ->. Here's an example of using the fetch API:
(-> (js/fetch "/data")
(.then (fn [r]
(when-not (.-ok r)
(throw (js/Error. "Could not fetch /data")))
(.json r)))===============
The most effective way to get bugs out of code is code review. More than running the code, more than unit tests, having someone else review an author's code is the best technique known to eliminate bugs (Fagan 1975 and Cohen 2006).
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. 🔥
| lines = File.stream!("file_path") | |
| chunks = File.stream!("file_path",[],2_048) | |
| hash_fun = fn enum -> | |
| enum | |
| |> Enum.reduce(:crypto.hash_init(:sha),&(:crypto.hash_update(&2, &1))) | |
| |> :crypto.hash_final() | |
| |> Base.encode16() | |
| end |
| // NEEDS TO RUN IN SECURE (HTTPS) CONTEXT. | |
| async function run() { | |
| // New key pair | |
| var keyPair = await window.crypto.subtle.generateKey( | |
| { | |
| name: "ECDSA", | |
| namedCurve: "P-521" | |
| }, | |
| true, | |
| ["sign", "verify"] |
For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):
List All System Images Available for Download: sdkmanager --list | grep system-images
Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"