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 <Foundation/Foundation.h> | |
| @interface NSURL (dictionaryFromQueryString) | |
| -(NSDictionary *) dictionaryFromQueryString; | |
| @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
| platform :ios, '5.1' | |
| pod 'AFNetworking', '1.1.0' | |
| target :NSRemoteJsonObjectTests, :exclusive => true do | |
| pod 'Kiwi' | |
| 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
| % git clone git@github.com:{ACCOUNT_NAME}/{ACCOUNT_NAME}.github.io.git | |
| Cloning into '{ACCOUNT_NAME}.github.com'... | |
| remote: Counting objects: 895, done. | |
| remote: Compressing objects: 100% (366/366), done. | |
| remote: Total 895 (delta 500), reused 880 (delta 486) | |
| Receiving objects: 100% (895/895), 1.02 MiB | 368 KiB/s, done. | |
| Resolving deltas: 100% (500/500), done. |
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 selector | |
| SEL selector = @selector(postToURL:withParams:async:); | |
| // get method signeture | |
| NSMethodSignature* signature = [[self class] methodSignatureForSelector: selector]; | |
| // make NSInvocation instance | |
| NSInvocation* invocation = [ NSInvocation invocationWithMethodSignature: signature ]; | |
| [invocation setSelector:selector]; | |
| [invocation setTarget:[self class]]; | |
| [invocation setArgument:&strurl atIndex:2]; | |
| [invocation setArgument:¶ms atIndex:3]; |
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 <SimpleRemoteObject/SRSimpleRemoteObject.h> | |
| @interface User : SRSimpleRemoteObject | |
| @property(nonatomic,retain) NSString *name; | |
| @property(nonatomic,retain) NSString *email; | |
| @property(nonatomic) int age; | |
| @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
| SPEC_BEGIN(PropertyUtil) | |
| describe(@"SimpleRemoteObject", ^{ | |
| context(@"read timeout", ^{ | |
| beforeAll(^{ | |
| [SRRemoteConfig defaultConfig].baseurl = @"http://localhost:2000/"; | |
| [SRRemoteConfig defaultConfig].timeout = 2; | |
| }); | |
| it(@"should timeout with specified second", ^{ |
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
| @implementation Singleton | |
| static NSMutableDictionary *_instances; | |
| + (id) sharedInstance { | |
| __block Singleton *obj; | |
| @synchronized(self) { | |
| if ([_instances objectForKey:NSStringFromClass(self)] == nil) { | |
| obj = [[self alloc] initSharedInstance]; | |
| } | |
| } |
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
| package 'curl' | |
| execute "Opscode Chef Client Installer for Ubuntu" do | |
| command 'curl -L https://www.opscode.com/chef/install.sh | sudo bash' | |
| not_if '/usr/bin/chef-client --version | /bin/grep "Chef: 11."' | |
| 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
| // | |
| // GRViewController.m | |
| // MapBoxSample | |
| // | |
| // Created by Haruyuki Seki on 12/9/13. | |
| // Copyright (c) 2013 Georepublic. All rights reserved. | |
| // | |
| #import "GRViewController.h" | |
| #import <MapBox/MapBox.h> |