This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Because swift thinks remainder is cooler than modulus | |
func modulus(number: Double, modulo: Double) -> Double { | |
var result = number % modulo | |
if result < 0 { | |
result += modulo | |
} | |
return result | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set operations taken from | |
// https://en.wikipedia.org/wiki/Set_(mathematics) | |
import Foundation | |
// The empty set | |
let Ø = NSSet() | |
// The "Universal" set | |
let U = NSMutableSet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# We need the TAB character for SED (Mac OS X sed does not understand \t) | |
TAB="$(printf '\t')" | |
function abort { | |
echo "$(tput setaf 1)$1$(tput sgr0)" | |
exit 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' |