Skip to content

Instantly share code, notes, and snippets.

View leifericf's full-sized avatar

Leif Eric Fredheim leifericf

View GitHub Profile
@leifericf
leifericf / CLAUDE.md
Created April 6, 2026 13:14
Clojure Programming Guidelines for AI Agents

Clojure Programming Guidelines for AI Agents

“Programmers know the benefits of everything and the trade‑offs of nothing.”
This file exists to force trade‑offs into the open for Clojure code generated by AI agents.

Purpose

This document defines constraints, idioms, and expectations for any AI agent generating or modifying Clojure or ClojureScript code in this repository.

The agent must:

@leifericf
leifericf / install-java-macos.md
Last active July 18, 2024 19:24
Installing Java on macOS and Adding It to jEnv

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install jEnv using Homebrew:

brew install jenv

Add the cask-versions tap to Homebrew:

@leifericf
leifericf / bb.edn
Last active January 9, 2024 20:21
Consuming 3rd Party APIs Using Clojure (Babashka)
{:paths ["src"]
:deps {org.babashka/json {:mvn/version "0.1.1"}}}
@leifericf
leifericf / git-hash.rb
Last active August 29, 2015 14:03
Generate Git file (aka "blob") hash, without using Git.
#!/usr/bin/env ruby
require 'digest/sha1'
def git_hash(file)
data = File.read(file)
size = data.bytesize.to_s
Digest::SHA1.hexdigest('blob ' + size + "\0" + data) # Git's hashing algorithm
end
@leifericf
leifericf / binet.rb
Last active August 29, 2015 14:02
Binet's Formula and Fibonacci Numbers
#!/usr/bin/env ruby
=begin
Ref. Python implementation from this answer on StackOverflow:
http://stackoverflow.com/a/7843192/195964
=end
include Math
=begin