This file contains 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
import UIKit | |
import XCTest | |
// Wasteful and Helpful tests | |
class SomeViewController { | |
let model: Model | |
let statusLabel: UILabel | |
let buttonColor: UIColor | |
init(_ model: Model) { |
This file contains 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
timezones: { | |
ADT = "America/Halifax"; | |
AKDT = "America/Juneau"; | |
AKST = "America/Juneau"; | |
ART = "America/Argentina/Buenos_Aires"; | |
AST = "America/Halifax"; | |
BDT = "Asia/Dhaka"; | |
BRST = "America/Sao_Paulo"; | |
BRT = "America/Sao_Paulo"; | |
BST = "Europe/London"; |
This file contains 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
var tempText = ":a/b?c,d=e&f" | |
var replacements = [ | |
(":","%3A"), | |
("/","%2F"), | |
("?","%3F"), | |
(",","%2C"), | |
("=","%3D"), | |
("&","%26")] |
This file contains 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
//Smalltalk's "collect", haskell's "map" | |
- (NSArray *) arrayByEvaluatingBlock:(id(^)(id object))block { | |
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[self count]]; | |
for (id object in self) { | |
[array addObject:block(object)]; | |
} | |
return [array copy]; | |
} | |
//Smalltalk's and haskell's "filter" |