Skip to content

Instantly share code, notes, and snippets.

View goreilly's full-sized avatar

Garrett O'Reilly goreilly

  • San Francisco, CA
View GitHub Profile
@martinezdelariva
martinezdelariva / CartesianProductIterator.php
Created March 30, 2015 11:24
Cartesian Product Iterator
// Usage:
$cartesianProductIt = new CartesianProduct(array(
new \ArrayIterator(array(1, 2)),
new \ArrayIterator(array('a', 'b'))
));
// Output on traverse
// array(1, 'a'),
// array(1, 'b'),
// array(2, 'a'),
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {