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
.__ ___. .__ __ .__ .___ | |
| |__ _____ ______ ______ ___.__. \_ |__ |__|_______ _/ |_ | |__ __| _/_____ ___.__. | |
| | \ \__ \ \____ \ \____ \< | | | __ \ | |\_ __ \\ __\| | \ / __ | \__ \ < | | | |
| Y \ / __ \_| |_> >| |_> >\___ | | \_\ \| | | | \/ | | | Y \/ /_/ | / __ \_\___ | | |
|___| /(____ /| __/ | __/ / ____| |___ /|__| |__| |__| |___| /\____ | (____ // ____| | |
\/ \/ |__| |__| \/ \/ \/ \/ \/ \/ | |
_____ ___ ___ ___ ___ ___ | |
/ /::\ / /\ / /\ /__/\ /__/\ /__/| ___ | |
/ /:/\:\ / /:/_ / /:/_ \ \:\ \ \:\ | |:| / /\ | |
/ /:/ \:\ / /:/ /\ / /:/ /\ \ \:\ \ \:\ | |:| / /:/ |
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
ZONE = "us-east-1b" | |
# Kill them all | |
for instance in EC2::Instance.all | |
instance.terminate if instance.running? | |
end | |
instance = EC2::Instance.run("ami-71fd1a18", :availability_zone => ZONE, :key => "ec2-keypair").first | |
instance.wait!(:running) |
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
Animal = {} | |
function Animal:new(o) | |
o = o or {} | |
setmetatable(o, self) | |
self.__index = self | |
return o | |
end |
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
#ifdef DEBUG | |
static NSString *url = @"http://localhost" | |
#else | |
static NSString *url = @"http://blah.com" | |
#endif |
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
id a = [NSString alloc]; | |
id b = [a initWithFormat:@"Hello]; | |
// a != b | |
// [NSString alloc] just creates a placeholder object... the init classes actually do the allocating |
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
obj.is_a? Array # => true | |
Array === obj # => false |
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
- (id)init { | |
self = [super initWithNibName:@"BankView" bundle:nil]; | |
if (!self) return self; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:self.view.window]; | |
[[NSNotificationCenter defaultCenter] addObserver:self |
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
[connection addToQueue:someObject method:@selector(update)]; | |
[connection addToQueue:anotherObject method:@selector(update)]; | |
[connection beginQueue]; |
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 <Foundation/Foundation.h> | |
#import "Detective.h" | |
@interface TwitterStatus : Detective | |
} | |
@property (nonatomic, retain) NSNumber *twitterID | |
@property (nonatomic, retain) NSString *text | |
@end |
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
class("SimpleTableViewController", "UITableViewController") | |
function tableView_numberOfSectionsInTableView(tableView, section) | |
return 1 | |
end | |
function tableView_numberOfRowsInSection(tableView, section) | |
return 1 | |
end |
OlderNewer