Skip to content

Instantly share code, notes, and snippets.

View practicalli-johnny's full-sized avatar
😺
Software Engineering education and advocacy with a focus on Clojure

Practicalli Johnny practicalli-johnny

😺
Software Engineering education and advocacy with a focus on Clojure
View GitHub Profile
@practicalli-johnny
practicalli-johnny / gist:50e164cb31b7f9c76a42c24d45212215
Created March 18, 2024 12:56
Test Driven Documentation concept - encouraging engineers to write effective documents
Test: identify what is to be communicated
- product, tools, concepts, designs, tips
- identify audience
Document: write the document
- start with a braindump (avoid staring at a blank page)
- dont worry about prose, flow or format initially
- capture all the facts and useful examples
@practicalli-johnny
practicalli-johnny / cider-clojurescript-jack-in-command.sh
Created October 11, 2023 07:40
CIDER ClojureScript Jack-in command
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.39.0\"\}\ cider/piggieback\ \{\:mvn/version\ \"0.5.3\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\,cider.piggieback/wrap-cljs-repl\]\"\]\}\}\} -M:figwheel/env:cider/nrepl
@practicalli-johnny
practicalli-johnny / unencrypt-lvm2.sh
Created October 1, 2023 21:58
Access Linux LVM2 Encrypted disk from Ubuntu Live ISO
# Access encrypted LVM2 partition from Ubuntu Live ISO image
# Reference: https://askubuntu.com/questions/63594/mount-encrypted-volumes-from-command-line
# Use gparted to unencrypt the partition if required (right click on the partition name)
# Install the Lvm package (usually included inthe live USB image)
sudo apt-get install lvm2
# verify the LVM partitions are detected
@practicalli-johnny
practicalli-johnny / zshrc
Last active August 7, 2023 17:43
Neovim zsh selector
# Neovim switcher
alias astro="NVIM_APPNAME=astronvim nvim"
alias nvim-practicalli="NVIM_APPNAME=neovim-config nvim"
alias nvim-practicalli-redux="NVIM_APPNAME=neovim-config-redux nvim"
alias nvim-magic-kit="NVIM_APPNAME=neovim-magic-kit nvim"
alias nvim-katawful="NVIM_APPNAME=neovim-katawful nvim"
alias nvim-chad="NVIM_APPNAME=NvChad nvim"
alias nvim-astro-old="NVIM_APPNAME=neovim-astronvim nvim"
alias nvim-nyoom="NVIM_APPNAME=neovim-nyoom nvim"
{:final-settings
{:paths-ignore-regex [],
:source-paths-ignore-regex ["target.*" "target.*"],
:api {:exit-on-errors? true},
:compute-external-file-changes true,
:code-lens {:segregate-test-references true},
:source-aliases #{:env/dev :lib/reloaded :env/test :test :dev},
:uri-format
{:upper-case-drive-letter? false, :encode-colons-in-path? false},
:cljfmt-config-path "cljfmt.edn",
@practicalli-johnny
practicalli-johnny / gist:244204f4a02676428825c80e9e5990ee
Created March 18, 2023 13:37
lsp-clojure-server-info--good.txt
LSP :: {:final-settings
{:api {:exit-on-errors? true},
:lens-segregate-test-references true,
:code-lens {:segregate-test-references true},
:source-aliases #{:env/dev :lib/reloaded :env/test :test :dev},
:uri-format
{:upper-case-drive-letter? false, :encode-colons-in-path? false},
:cljfmt-config-path ".cljfmt.edn",
:semantic-tokens? true,
:document-formatting? true,

Hints on using the Terminal

Kitty terminal

fonts

kitty +list-fonts

kitty --debug-font-fallback

(ns mock-data-experiments
"Experimenting with specifications for data structures used in the Fraud API")
;; --------------------------------------------------
;; Data generators
(comment
;; (require '[clojure.spec.alpha :as spec])
@practicalli-johnny
practicalli-johnny / git-rebase-change-author.sh
Last active November 21, 2022 23:49
Reset author on a range of existing commits in the Git commit history
# Rebase existing commit history and update the author information
# Useful when using multiple Git identities, work/community, etc.
# and the incorrect identity was used for a commit
# usually due to project `.git/config` not set to right identity
# Call script with relevant SHA (first 7 characters) of the earliest commit
# from where the author should be reset
# git-rebase-reset-author.sh abc4ef7
git rebase -i $1 -x "git commit --amend --reset-author -CHEAD"
@practicalli-johnny
practicalli-johnny / .dockerignore
Created November 6, 2022 16:32
Docker ignore patterns for a Clojure project - explicitly ignoring specific files and directories
# Clojure file patterns to exclude from Docker image
# when using the COPY command
#
# Alternative: exclude everything and only include specific files and directories
# - https://gist.github.com/practicalli-john/b5db240801d9024184de626e42036800
# .cpcache/ classpaths are only relevant to use account and environment
# so local .cpcache different to that for Docker
.cpcache/
.nrepl-port