Skip to content

Instantly share code, notes, and snippets.

View probablycorey's full-sized avatar
👯‍♂️
Dancing with my twin

Corey Johnson probablycorey

👯‍♂️
Dancing with my twin
View GitHub Profile
.__ ___. .__ __ .__ .___
| |__ _____ ______ ______ ___.__. \_ |__ |__|_______ _/ |_ | |__ __| _/_____ ___.__.
| | \ \__ \ \____ \ \____ \< | | | __ \ | |\_ __ \\ __\| | \ / __ | \__ \ < | |
| Y \ / __ \_| |_> >| |_> >\___ | | \_\ \| | | | \/ | | | Y \/ /_/ | / __ \_\___ |
|___| /(____ /| __/ | __/ / ____| |___ /|__| |__| |__| |___| /\____ | (____ // ____|
\/ \/ |__| |__| \/ \/ \/ \/ \/ \/
_____ ___ ___ ___ ___ ___
/ /::\ / /\ / /\ /__/\ /__/\ /__/| ___
/ /:/\:\ / /:/_ / /:/_ \ \:\ \ \:\ | |:| / /\
/ /:/ \:\ / /:/ /\ / /:/ /\ \ \:\ \ \:\ | |:| / /:/
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)
Animal = {}
function Animal:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
#ifdef DEBUG
static NSString *url = @"http://localhost"
#else
static NSString *url = @"http://blah.com"
#endif
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
obj.is_a? Array # => true
Array === obj # => false
- (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
[connection addToQueue:someObject method:@selector(update)];
[connection addToQueue:anotherObject method:@selector(update)];
[connection beginQueue];
#import <Foundation/Foundation.h>
#import "Detective.h"
@interface TwitterStatus : Detective
}
@property (nonatomic, retain) NSNumber *twitterID
@property (nonatomic, retain) NSString *text
@end
class("SimpleTableViewController", "UITableViewController")
function tableView_numberOfSectionsInTableView(tableView, section)
return 1
end
function tableView_numberOfRowsInSection(tableView, section)
return 1
end