Skip to content

Instantly share code, notes, and snippets.

View pmonks's full-sized avatar
👔
Preparing TPS report cover pages

Peter Monks pmonks

👔
Preparing TPS report cover pages
View GitHub Profile
@pmonks
pmonks / AI-Use-Restriction-Addendum-1.0.txt
Last active February 7, 2026 01:44
AI Use Restriction Addendum, version 1.0
AI‑USE RESTRICTION ADDENDUM, Version 1.0
This Addendum imposes additional conditions restricting certain uses of the
Licensed Work in connection with Artificial Intelligence systems. When properly
attached or referenced by the Licensor, this Addendum forms part of the license
terms governing the Licensed Work.
0. DEFINITIONS
@dustingetz
dustingetz / hyperfiddle-clojure-ns-browser.md
Last active August 19, 2025 16:31
hyperfiddle clojure namespace browser

Clojure namespace browser – Hyperfiddle example app

See source code below.

CleanShot 2025-07-20 at 16 01 40
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active February 6, 2026 17:27
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@IGJoshua
IGJoshua / regex-cond.clj
Created February 18, 2022 17:15
Cond expressions to bind regex capture groups
(require '[clojure.spec.alpha :as s])
(defn- regex-cond-helper
[expr-sym clauses default]
(if-not (empty? clauses)
(let [inner-clause (regex-cond-helper expr-sym (rest clauses) default)
{:keys [regex bindings body] :as clause} (first clauses)
regex (case (first regex)
:regex (second regex)
:else `(re-pattern ~(second regex)))
@borkdude
borkdude / api_diff_bb.clj
Created January 8, 2021 10:13
Print API breakage warnings
#!/usr/bin/env bb
;; Example usage:
;; api_diff_bb.clj org.clojure/clojure "1.9.0" "1.10.1"
;; Output:
;; clojure/core_deftype.clj:587:1: warning: Arity 4 of clojure.core/emit-method-builder was removed.
;; clojure/core/reducers.clj:24:1: warning: clojure.core.reducers/compile-if was removed.
(require '[babashka.pods :as pods])

Number of hands of poker

Poker users a 52-card deck, where each card is unique. After shuffling, a player gets five random cards. How many different hands are there? Remember, in poker, the order of the cards in your hand does not matter.

Write a function that takes the number of cards in a hand h and the number of cards in the deck d and calculates how many possible hands there are.

(defn combinations [d h]
  .....
)
@yogthos
yogthos / clojure-beginner.md
Last active January 24, 2026 08:28
Clojure beginner resources

Introductory resources

@koshatul
koshatul / README.md
Last active January 16, 2026 18:16
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@fnky
fnky / ANSI.md
Last active February 6, 2026 23:59
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@jashkenas
jashkenas / semantic-pedantic.md
Last active January 14, 2026 08:17
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil