Skip to content

Instantly share code, notes, and snippets.

View indiebrain's full-sized avatar

Aaron Kuehler indiebrain

View GitHub Profile
@indiebrain
indiebrain / gpg_decrypt_examples.md
Last active April 8, 2016 17:12
How to decrypt an armored GPG payload, inline, on the CLI

With echo

$ echo -n "<gpg string>" | gpg --decrypt

With tee

# IntegerGuesser.guess(number, range)
# Conducts a binary serach within the range for the integer and
# reports its path along the way.
#
# EX:
# iex(1)> IntegerGuesser.guess(273, 1..1000)
# Is it 500?... Nope
# Is it 249?... Nope
# Is it 375?... Nope
# Is it 311?... Nope
@indiebrain
indiebrain / core.clj
Created November 19, 2011 02:23
A lazy sequence implementation of the fizzbuzz problem.
(ns fizzbuzz.core)
(defn divisible [x n]
(if (= 0 (mod x n))
:true))
(defn nth-fizzbuzz-term [n]
(cond (and (divisible n 3) (divisible n 5)) :fizzbuzz
(divisible n 3) :fizz
(divisible n 5) :buzz