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
NSString *url = @"http://api.twitter.com/1/users/show.json?screen_name=probablycorey";
[Seriously get:url handler:^(SeriouslyResponse *response, NSError *error) {
if (error) {
NSLog(@"Got error %@", error);
}
else {
NSLog(@"%@", [response.body objectForKey:@"username"]);
}
}];
// Why I Hate Objective-C
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"getPopular", @"method",
[NSString stringWithFormat:@"%d", [offset intValue]], @"offset",
nil];
waxClass{"AppDelegate", protocols = {"UIApplicationDelegate", "CAAnimationDelegate"}}
function applicationDidFinishLaunching(self, application)
local frame = UIScreen:mainScreen():bounds()
self.window = UIWindow:initWithFrame(frame)
self.window:setBackgroundColor(UIColor:orangeColor())
local label = UILabel:initWithFrame(CGRect(0, 100, 320, 40))
label:setFont(UIFont:boldSystemFontOfSize(30))
label:setColor(UIColor:orangeColor())
####
#########
## # ##
# # #
# # ##
# # ###
# #####
# #
## ###
titleAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
color, kCTForegroundColorAttributeName,
[font fontName], kCTFontNameAttribute,
[font pointSize], kCTFontSizeAttribute,
nil];
#import <UIKit/UIKit.h>
#import "lua.h"
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
if (luaL_dofile(L, "data/scripts/WHATEVER-FILE-IS-NAMED.dat") != 0) {
fprintf(stderr,"Fatal error: %s\n", lua_tostring(L,-1));
function myTest(word)
print("here comes the word!")
print(word)
end
myTest("It worked")
def test
a = 5
end
#define NSZombies
set env NSZombieEnabled=YES
set env NSDeallocateZombies=NO
set env MallocCheckHeapEach=100000
set env MallocCheckHeapStart=100000
set env MallocScribble=YES
set env MallocGuardEdges=YES
set env MallocCheckHeapAbort=1
set env MallocHelp=YES
h = {:a => 1, :b => 2, :c => 3}
h.find {|k, v| v == 2}