Skip to content

Instantly share code, notes, and snippets.

View mdb's full-sized avatar

Mike Ball mdb

View GitHub Profile
values = ["a", "b", "c"]
result = (1..values.length).inject([]) { |buffer, count|
buffer |= values.combination(count).to_a
}.map(&:join)
result # => ["a", "b", "c", "ab", "ac", "bc", "abc"]
@karlseguin
karlseguin / fakeresponse.go
Created March 10, 2013 12:51
A fake http.ResponseWriter class, used for testing. See http://openmymind.net/Testing-In-Go/
package fakeresponse
import (
"testing"
"net/http"
)
type FakeResponse struct {
t *testing.T
headers http.Header
@phred
phred / pedantically_commented_playbook.yml
Last active February 7, 2026 19:32
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####