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.
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.
| ;; This macro is also available in: https://github.com/wdhowe/clj-contrib | |
| (defmacro as-some-> | |
| "as->, with the nil checking of some->. | |
| Binds name to expr. When name is not nil, evaluates the first | |
| form in the lexical context of that binding. When that result | |
| is not nil, then binds name to result, repeating for each | |
| successive form." | |
| [expr name & forms] | |
| (let [steps (map (fn [step] `(if (nil? ~name) nil ~step)) |
| .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) |
Lein can be extended via plugins.
Some useful plugins are:
Leiningen is another method for managing Clojure projects. It is similar to pipenv in the Python world, in that it manages project space and dependent packages.
Offical Site: https://leiningen.org/
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| # Export a sensitive environment variable, hiding it from command history and the terminal. | |
| read -rs my_var ; export my_var | |
| # Don't forget to unset it later, when done | |
| unset my_var |