Skip to content

Instantly share code, notes, and snippets.

View pietrorea's full-sized avatar
✌️

Pietro Rea pietrorea

✌️
View GitHub Profile
@zetachang
zetachang / gist:4111314
Created November 19, 2012 15:37
Instruction on adding a Acknowledgements Settings.bundle
  • To add Settings.bundle in Xcode. Command N and in Resource, choose Settings Bundle .
  • Open Root.plist in source code, paste the code below to replace it,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>PreferenceSpecifiers</key>
	
@tarnfeld
tarnfeld / MMPageViewController.h
Created February 25, 2012 12:56
View controller rotation for page view controller child view controllers
#import <UIKit/UIKit.h>
@interface MMPageViewController : UIPageViewController
@end
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@sspencer
sspencer / AFNetworkingRequest.m
Created November 18, 2011 23:58
AFNetworking Request
// using ARC, so no release / autorelease
AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://localhost"]];
[client setAuthorizationHeaderWithUsername:@"steve" password:@"mypass"];
NSURLRequest *request = [client requestWithMethod:@"GET" path:@"/auth.php" parameters:nil];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation
setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"success: %@", operation.responseString);