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
static MySingleton *sharedInstance = nil; | |
@implementation MySingleton | |
#pragma mark - | |
#pragma mark class instance methods | |
#pragma mark - | |
#pragma mark Singleton methods |
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
ASIHTTPRequest: https://github.com/pokeb/asi-http-request | |
JSONKit: https://github.com/johnezang/JSONKit | |
EGOImageLoading: https://github.com/enormego/EGOImageLoading | |
EGOCache: https://github.com/enormego/EGOCache | |
FMDB: https://github.com/ccgus/fmdb | |
three20: https://github.com/facebook/three20 | |
------------------------------- | |
Facebook SDK: https://github.com/facebook/facebook-ios-sdk | |
------------------------------- |
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
#include <sys/types.h> | |
#include <ifaddrs.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
- (NSString *)getIPAddress | |
{ | |
NSString *address = @"error"; | |
struct ifaddrs *interfaces = NULL; | |
struct ifaddrs *temp_addr = NULL; | |
int success = 0; |
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
// Enumerable.h | |
#import <Foundation/Foundation.h> | |
typedef id (^InjectBlock)(id, id); | |
@interface NSArray (Enumerable) | |
- (id) inject:(id) initial block:(InjectBlock) block; | |
@end |
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
@protocol MyControlDelegate <NSObject> | |
@optional | |
- (void)delegateAction:(id)value; | |
@end | |
@interface MyControl : NSObject{ | |
id<MyControlDelegate> delegate; | |
} |
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
// A normal singleton | |
static AppInfo * sharedAppInfo = nil; | |
+ (AppInfo *) sharedAppInfo | |
{ | |
if ( sharedAppInfo == nil ) | |
{ | |
[[self alloc] init]; | |
} | |
return sharedAppInfo; |
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
#!/usr/bin/env ruby -w | |
require 'rubygems' | |
require 'hpricot' | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
require 'tempfile' | |
test_http = "https://gist.github.com/69457.txt" |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'fileutils' | |
require 'net/http' | |
require 'uri' | |
require "open-uri" | |
require 'nokogiri' | |
=begin rdoc | |
Clone all the public gists of a user. | |
Place each gist in a folder named for the gist_id |
NewerOlder