Skip to content

Instantly share code, notes, and snippets.

View symonty's full-sized avatar

Symonty symonty

View GitHub Profile
import Darwin
extension Array {
mutating func shuffle() -> Array {
// this will sometimes crash (submitted bug #17127524)
self.sort { _,_ in arc4random_uniform(2) == 1 }
return self
}
mutating func removeAtIndexes( i:Int... ) {
var indexes = i