Skip to content

Instantly share code, notes, and snippets.

View wdhowe's full-sized avatar

Bill Howe wdhowe

  • United States
View GitHub Profile
@wdhowe
wdhowe / debugging.md
Last active April 11, 2021 03:17
debugging
@wdhowe
wdhowe / as_some.clj
Last active September 5, 2025 13:50
Clojure macro: as-some->
;; 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))
@wdhowe
wdhowe / Makefile
Last active March 24, 2026 14:41
An example Makefile for Docker and Leiningen.
.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)
@wdhowe
wdhowe / docker-commands.md
Last active March 13, 2026 19:23
Docker commands to build, push, and run containers.

Docker Image Running/Building Examples

The docker images can all be run/built similar to the following.

Variables

Setup the variables per image.

GitHub Example

@wdhowe
wdhowe / clojure-lein-plugins.md
Last active February 3, 2024 21:09
Installing plugins for Clojure's Leiningen

Leiningen Plugins

Lein can be extended via plugins.

Some useful plugins are:

  • lein-ancient -> Check your project for outdated dependencies and plugins, as well as upgrade them if desired.
  • lein-exec -> Allows single clojure files to be executed and their requirements resolved.
  • lein-localrepo -> Work with local Maven repository.
  • lein-pprint -> Pretty-print a representation of the project map.
@wdhowe
wdhowe / clojure-lein-projects.md
Last active December 2, 2025 23:27
Creating Clojure projects with Leiningen

Leiningen Projects

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/

Install Leiningen

Mac

@wdhowe
wdhowe / clojure-tools-deps-projects.md
Last active February 22, 2026 20:34
Creating Clojure projects with deps.edn
@wdhowe
wdhowe / clojure-repl-help.md
Last active December 18, 2025 18:32
Clojure commands for getting help, docs and more while in the REPL

Clojure REPL Help

Commands that can be entered in the REPL for finding help, documentation, and more.

Load clojure REPL helper functions

(require '[clojure.repl :refer :all])
@wdhowe
wdhowe / clojure-install.md
Last active December 12, 2025 01:32
Install the Clojure Programming Language
# 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