TLDR to copy and paste a clojure dev setup on MacOS.
Install packages
brew install openjdk rlwrap clojure leiningen borkdude/brew/babashka babashka/brew/neil visual-studio-code| ##-- Aliases --## | |
| alias ll='ls -l' | |
| alias k='kubectl' | |
| alias ke='kubectl exec -it' | |
| alias kc='kubectx' | |
| alias kn='kubens' | |
| ##-- Completions --## | |
| # bash-completion@2 (installed via brew install bash-completion@2) | |
| [[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh" |
Notes from watching Stuart Halloway's "Debugging with the Scientific Method" from Clojure/conj 2015.
Clear problem statement: steps you took, what you expected, what actually happened.
Efficient hypothesis: bisect the problem.
| .PHONY: build test deploy | |
| ##-- Environment Variables --# | |
| # Image and container registry | |
| IMAGE_NAME := my-image-name | |
| IMAGE_PATH := mygroup/myproject | |
| REGISTRY := registry-url:port | |
| IMAGE := $(REGISTRY)/$(IMAGE_PATH)/$(IMAGE_NAME) |
Clojure CLI tools (with deps.edn) allow for a built in way to create projects.
Official CLI/deps guide: https://clojure.org/guides/deps_and_cli
Official site: https://www.clojure.org/index
brew install openjdk clojure rlwrap| ;; Returns a function with retries. | |
| ;; retries: num of retries | |
| ;; delay: delay between retries in milliseconds | |
| ;; f: function to apply | |
| ;; ef: error function, determines if f should be retried | |
| ;; f and ef should not throw Exceptions | |
| (defn with-retry | |
| [retries delay f ef] | |
| (fn [& args] |