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
| 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"]); | |
| } | |
| }]; |
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
| // Why I Hate Objective-C | |
| NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys: | |
| @"getPopular", @"method", | |
| [NSString stringWithFormat:@"%d", [offset intValue]], @"offset", | |
| nil]; |
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
| 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()) |
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
| #### | |
| ######### | |
| ## # ## | |
| # # # | |
| # # ## | |
| # # ### | |
| # ##### | |
| # # | |
| ## ### |
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
| titleAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: | |
| color, kCTForegroundColorAttributeName, | |
| [font fontName], kCTFontNameAttribute, | |
| [font pointSize], kCTFontSizeAttribute, | |
| nil]; |
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> | |
| #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)); |
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
| function myTest(word) | |
| print("here comes the word!") | |
| print(word) | |
| end | |
| myTest("It worked") |
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
| def test | |
| a = 5 | |
| end |
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
| #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 |
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
| h = {:a => 1, :b => 2, :c => 3} | |
| h.find {|k, v| v == 2} |