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 / .dockerignore
Created November 6, 2022 16:25
Docker ignore file and directory patterns - excluding everything and explicitly including files and directories needed for a build
# ------------------------
# Docker Ignore file patterns
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
#
# Ignore all local files when using the COPY command in Dockerfile
# except patterns starting with !
# reducing the amount of time required to copy files
# ------------------------
@practicalli-johnny
practicalli-johnny / Dockerfile
Created October 31, 2022 14:42
Dockerfile that builds a Java Run-time Enironment (JRE) and a Clojure service and deploys them on an Alpine image
# ---------------------------------------- #
# Multi-stage Dockerfile optomised for size
# - build JRE
# - build Clojure service
# - run Clojure Service on JRE
# ---------------------------------------- #
# Example of custom Java runtime using jlink in a multi-stage container build
FROM eclipse-temurin:17-alpine as jre-build
# ------------------------------------------
# Build and run Practicalli Gameboard API Service
#
# Author: Practicalli
#
# Builder image:
# Official Clojure Docker image with Java 17 (eclipse-temurin) and Clojure CLI
# https://hub.docker.com/_/clojure/
#
# Run-time image:
@practicalli-johnny
practicalli-johnny / dev-user.clj
Created October 17, 2022 11:48
Custom Clojure user namespace to be loaded during development to provide tools for a REPL driven workflow
;; --------------------------------------------------
;; REPL Driven Development namespace
;; - start REPL with `:env/dev` alias to include this namespace
;;
;; - Commands to start, restart, fraud system with Integrant REPL
;; & view system configuration
;; - Test API endpoints
;; - Hotload libraries into a running REPL process
;; - Inspect evaluation results with Portal
;; --------------------------------------------------
(ns practicalli.app.middleware
(:require
[com.brunobonacci.mulog :as mulog]))
;;;; Logging middleware
;; https://github.com/BrunoBonacci/mulog/blob/master/doc/ring-tracking.md
(defn wrap-trace-events
"Log event trace for each api event with mulog/log."
[handler id]
@practicalli-johnny
practicalli-johnny / firefox-snap-to-deb.sh
Created May 30, 2022 16:41 — forked from jc00ke/firefox-snap-to-deb.sh
Migrate Firefox from snap back to deb on Ubuntu Jammy+
#!/bin/env bash
sudo snap remove firefox
sudo add-apt-repository ppa:mozillateam/ppa
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
@practicalli-johnny
practicalli-johnny / gist:bb5a40902c48d30651317418c056f903
Last active May 20, 2022 11:29
Emacs configure output example
checking for xcrun... no
checking for GNU Make... make
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
# An example global gitignore file
#
# Place a copy if this at ~/.gitignore-global
# Run `git config --global core.excludesfile ~/.gitignore-global`
## Clojure tooling ##
#####################
**/.calva
**/.carve
**/.clj-kondo/.cache
@practicalli-johnny
practicalli-johnny / regolith-linux-install-xdg.md
Last active May 18, 2022 09:49
Regolith Linux install on Sidious

Install Regolith Linux Ubuntu 20.04 EFI ISO

Use entire Laptop hard disk (No LLVM)

Post Install

Boot Regolith Linux (do not use desktop login)

Ctrl-Alt-F2 for terminal login

[Desktop Entry]
Name=Spacemacs
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacs %F
Icon=/home/practicalli/.config/emacs/core/banners/img/spacemacs.png
Type=Application
Terminal=false
Categories=Development;TextEditor;