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
#!/usr/bin/ruby | |
require 'webrick' | |
include WEBrick | |
s = HTTPServer.new(:Port => 3000, :DocumentRoot => Dir::pwd) | |
['INT', 'TERM'].each { |sig| trap(sig) { s.shutdown } } | |
s.start |
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
#import <UIKit/UIKit.h> | |
int main(int argc, char *argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"LapTimerAppDelegate"); | |
[pool release]; | |
return retVal; | |
} |
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
int (^minusOne)(int); | |
minusOne = ^(int myNumber) { | |
return myNumber - 1; | |
}; | |
NSLog(@"%d", minusOne(3)); // Will print: 2 |
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
/* | |
Example custom UIView implementation | |
------------------------------------ | |
Used as a custom UITableView header cell. | |
*/ | |
- (id)initWithFrame:(CGRect)frame { | |
if ((self = [super initWithFrame:frame])) { | |
userName = [[UILabel alloc] initWithFrame:CGRectMake(70, 16, (self.bounds.size.width - 70), 28)]; |
NewerOlder