Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am calamitous on github.
  • I am calamitous (https://keybase.io/calamitous) on keybase.
  • I have a public key ASA43YhXQS0z9LamN5xxA_lnEUv25VNJP30eETBiKhstGgo

To claim this, I am signing this object:

#!/usr/bin/env ruby
gem 'minitest'
require 'minitest/autorun'
class Array
# Provide a method to remove all nesting from arbitrarily nested arrays
def flattener
# For each element in the array, either:
self.reduce([]) do |accumulator, element|
if element.is_a?(Array)
@Calamitous
Calamitous / two_small_projects.txt
Created June 28, 2017 00:27
A Brief Overview of Two Small Ruby Projects
The first entry is an implementation of the Luhn algorithm, a checksum commonly
used to validate credit card numbers:
https://github.com/Calamitous/Luhn-algorithm
The operation is straightforward; initialize the Luhn class with a number, and
the `valid?` instance method will return a true or a false if the checksum
checks out.
This was a small exercise to exhibit Ruby's object orientation, testability, and
@Calamitous
Calamitous / output.png
Created June 28, 2011 19:33
CodeBrawl entry for "Pixelizing images with ChunkyPNG"
output.png