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
- (UIImage *)pspdf_preloadedImage { | |
CGImageRef image = self.CGImage; | |
// make a bitmap context of a suitable size to draw to, forcing decode | |
size_t width = CGImageGetWidth(image); | |
size_t height = CGImageGetHeight(image); | |
CGColorSpaceRef colourSpace = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef imageContext = CGBitmapContextCreate(NULL, width, height, 8, width*4, colourSpace, | |
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); |
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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
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
NSString *_path = [[NSString alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest getRequestWithPath:_path] retain]; | |
//Asynchronous request | |
[gcRequest getRequestInBackgroundWithPath:_path withResponse:^(GCResponse *response) { | |
NSLog(@"%@", response); |
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
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest postRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
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
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest putRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
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
NSString *_path = [[NSString alloc] init]; | |
NSDictionary *_params = [[NSDictionary alloc] init]; | |
GCRequest *gcRequest = [[GCRequest alloc] init]; | |
//Synchronous Request | |
GCResponse *_response = [[gcRequest deleteRequestWithPath:_path andParams:_params] retain]; | |
//Asynchronous request |
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
GCChute *_newChute = [GCChute new]; | |
[_newChute setName:@"Hello World"]; | |
//Set Permissions for a Chute | |
[_newChute setPermissionView:GCPermissionTypePublic]; | |
[_newChute setPermissionAddMembers:GCPermissionTypePublic]; | |
[_newChute setPermissionAddPhotos:GCPermissionTypePublic]; | |
[_newChute setPermissionAddComments:GCPermissionTypePublic]; | |
[_newChute setModeratePhotos:GCPermissionTypePublic]; |
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
//Synchronous Request | |
GCResponse *_response = [GCChute all]; | |
for (GCChute *chute in [_response object]) { | |
//Individual Chutes | |
NSLog(@"%@", chute); | |
} | |
//Asynchronous Request | |
[GCChute allInBackgroundWithCompletion:^(GCResponse *response) { |
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
//Synchronous Request | |
GCResponse *response = [GCChute findById:42]; | |
GCChute *chute = [response object]; | |
//Asynchronous Request | |
[GCChute findById:42 inBackgroundWithCompletion:^(GCResponse *response) { | |
GCChute *chute = [response object]; | |
}]; |
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
GCResponse *response = [GCChute findById:29]; | |
GCChute *chute = [response object]; | |
[chute setName:@"NewName"]; | |
//Synchronous Request | |
if ([chute update]) { | |
//Updated | |
} |
OlderNewer