Skip to content

Instantly share code, notes, and snippets.

View angusiguess's full-sized avatar
💭
hi

Angus Fletcher angusiguess

💭
hi
View GitHub Profile
@angusiguess
angusiguess / biblio.md
Last active May 6, 2023 21:52
Emulators, Immutability, and Time Travel
@angusiguess
angusiguess / component.org
Created February 9, 2017 16:15
Component, What and Why

Component: What and Why

Problem:

At some point when you’re building a clojure app or a service, you realize that you’ve got a lot of things that refer to external dependencies. These can be database connections, loggers, metrics publishers, etc.

When I started building apps I’d just pass these dependencies into routes or go-loops or other semi-stateful parts of my system and call it a day.

(ns forth.core
(:require [clojure.edn :as edn]
[clojure.string :as str]
[clojure.core :as c])
(:refer-clojure :exclude [read pop + - * /]))
;; Every function in the runtime operates on env, stack and returns env, stack, ret
;; Where env is a dict of lookups to functions
;; Let's cheat and lean on clojure's reader for a bunch of stuff. for example
@angusiguess
angusiguess / sephirot.sh
Last active February 11, 2016 17:30
What's Kanye's album called?
# TLOP by speaking the sefirot.
while [ "$tlop" != "the life of Pablo" ];
do
tlop=$(echo `grep "^[tT].*" /usr/share/dict/american-english | shuf -n 1` `grep "^[lL].*" /usr/share/dict/american-english | shuf -n 1` `grep "^[oO].*" /usr/share/dict/american-english| shuf -n 1` `grep "^[pP].*" /usr/share/dict/american-english| shuf -n 1`)
echo $tlop
sleep 2
done

Keybase proof

I hereby claim:

  • I am angusiguess on github.
  • I am angusiguess (https://keybase.io/angusiguess) on keybase.
  • I have a public key whose fingerprint is 2589 3CEF 0D8D BCDE 6A3F 1936 E5A3 7899 63DD CBDD

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am angusiguess on github.
* I am angusiguess (https://keybase.io/angusiguess) on keybase.
* I have a public key whose fingerprint is 0400 A17C ABF4 6A17 B4F1 4C45 F574 8AFC 47A9 D5AF
To claim this, I am signing this object:
@angusiguess
angusiguess / stm-talk.clj
Created February 26, 2013 23:26
Supporting code for a talk on STM in Clojure
(ns stm-talk.core)
;;This creates our ledger
(def ledger (ref {}))
(defn journal
"Apply a debit and credit simultaneously to a given account."
[debit credit amount]
(dosync
(when (nil? (@ledger debit)) (alter ledger assoc debit 0))