Skip to content

Instantly share code, notes, and snippets.

View wdhowe's full-sized avatar

Bill Howe wdhowe

View GitHub Profile
@wdhowe
wdhowe / local-clj-docs.md
Last active February 3, 2024 18:22
Analyze Clojure Docs Locally
View local-clj-docs.md

Analyze Clojure Docs Locally

Analyzing your project via the cljdoc-analyzer locally will ensure that when your project is pushed to clojars, the API docs will have a much better chance of successfully generating.

Install the cljdoc-analyzer.

clojure -Ttools install io.github.cljdoc/cljdoc-analyzer '{:git/tag "RELEASE"}' :as cljdoc
@wdhowe
wdhowe / renew-expired-gpg-key.md
Last active February 3, 2024 20:59
Renew Expired GPG Key
View renew-expired-gpg-key.md

Extend your GPG key expiry

  • Find the ID of the expiring key. Note your key ID.

    gpg --list-secret-keys
  • Start editing the key.

@wdhowe
wdhowe / git-cheatsheet.md
Last active February 3, 2024 21:01
Git Commands Cheat Sheet
View git-cheatsheet.md

Git Commands Cheat Sheet

Configuration

List Current Global Settings

git config --global --list
@wdhowe
wdhowe / cert-check.sh
Created February 2, 2024 18:47
Certificate View from the Shell
View cert-check.sh
#!/bin/bash
url=$1
echo | \
openssl s_client -showcerts -servername ${url} -connect ${url}:443 2>/dev/null | \
openssl x509 -inform pem -noout -text
@wdhowe
wdhowe / errors_success.clj
Last active February 3, 2024 21:03
Clojure Errors/Success collection checking
View errors_success.clj
;; These protocols are also available in: https://github.com/wdhowe/clj-contrib
(defprotocol Errors
"A protocol for finding errors in a collection."
(errors [coll] "Returns a map of the `:counts/errors`, which are entries with `:error` keys."))
(extend-protocol Errors
clojure.lang.Sequential
(errors
[coll]
@wdhowe
wdhowe / broken-refs.md
Last active November 19, 2021 02:31
Fix git broken ref refs/remotes/origin/HEAD
View broken-refs.md

Error seen during git commands

"warning: ignoring broken ref refs/remotes/origin/HEAD"

The Fix

Check remote branches

git branch -r
@wdhowe
wdhowe / simplicity.md
Created April 11, 2021 03:34
simplicity
View simplicity.md

Simplicity

Notes from Rich Hickey's Simplicity Matters slides.

"Simplicity is the ultimate sophistication." -Leonardo da Vinci

Toolkit

Complexity Simplicity
@wdhowe
wdhowe / debugging.md
Last active April 11, 2021 03:17
debugging
View debugging.md
@wdhowe
wdhowe / as_some.clj
Last active February 3, 2024 21:04
Clojure macro: as-some->
View as_some.clj
;; 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 April 11, 2021 22:10
An example Makefile for Docker and Leiningen.
View Makefile
.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)