Code snippet from ABS.
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
# initialization file (not found) |
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
# varname=USER or PROFILE_PATH | |
# $varname == USER | |
# $$ pid of current process | |
# \$$varname == $USER in literal | |
# eval variable=..... evaluate and assign to variable | |
eval variable=\$$varname |
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
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
NSDictionary *parameters = @{@"foo": @"bar"}; | |
[manager POST:@"http://example.com/resources.json" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"JSON: %@", responseObject); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"Error: %@", error); | |
}]; |
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
list AFNetworking Snippets here. |
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
# vim:ft=Ruby | |
# | |
# Base Podfile template for projects targeting OSX and iOS | |
# | |
# Author: Francisco Garcia <[email protected]> | |
# https://github.com/fgarcia | |
# | |
# Last Update: 2012-11-28 | |
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
- (id)init { | |
if ((self = [super init])) { | |
NSString *sqLiteDb = [[NSBundle mainBundle] pathForResource:@"banklist" | |
ofType:@"sqlite3"]; | |
if (sqlite3_open([sqLiteDb UTF8String], &_database) != SQLITE_OK) { | |
NSLog(@"Failed to open database!"); | |
} | |
} | |
return self; |
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
# Use Gists to store entire functions | |
class QuickSort | |
def self.sort!(keys) | |
quick(keys,0,keys.size-1) | |
end | |
private | |
def self.quick(keys, left, right) |