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
# assumes 1.9.3-p0 is already installed in RVM (1.9.2) and you are in an empty gemset | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem | |
gem install rake | |
gem install archive-tar-minitar | |
gem install ruby_core_source | |
gem install columnize | |
gem install linecache19-0.5.13.gem -- --with-ruby-include="$rvm_path/src/`rvm tools strings`" | |
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include="$rvm_path/src/`rvm tools strings`" |
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
/* | |
Enhancement Request for Core Data | |
Apple Radar Issue #11130505 | |
http://openradar.appspot.com/radar?id=3173403 | |
I'd like to see an expansion of the Core Data framework that allows us to add a | |
transient property's underlying code via a block assigned on an | |
NSPropertyDescription, in order to provide an easy means to use transient properties | |
without subclassing the managed object. |
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
- (void)itShouldLoadFromNetworkUpdatingFromEmptyToFullWithSections { | |
[self bootstrapEmptyStoreAndCache]; | |
[self stubObjectManagerToOnline]; | |
UITableView* tableView = [UITableView new]; | |
RKFetchedResultsTableControllerSpecViewController* viewController = [RKFetchedResultsTableControllerSpecViewController new]; | |
RKFetchedResultsTableController* tableController = | |
[[RKFetchedResultsTableController alloc] initWithTableView:tableView viewController:viewController]; | |
tableController.resourcePath = @"/JSON/humans/all.json"; | |
tableController.sectionNameKeyPath = @"name"; |
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=`sh /etc/profile; which git` | |
version=`$git describe --tags --always` | |
count=`$git rev-list --all |wc -l` | |
echo -e "#define GIT_VERSION $version\n#define GIT_COMMIT_COUNT $count" > InfoPlist.h |
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
void DrawInsetBeveledRoundedRect( CGContextRef context, CGRect rect, CGFloat radius, UIColor *fillColor ) | |
{ | |
//contract the bounds of the rectangle in to account for the stroke | |
CGRect drawRect = CGRectInset(rect, 1.0f, 1.0f); | |
//contract the height by 1 to account for the white bevel at the bottom | |
drawRect.size.height -= 1.0f; | |
//Save the current state so we don't persist anything beyond this operation | |
CGContextSaveGState(context); |
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
// | |
// MNDocumentController.h | |
// MindNodeTouch | |
// | |
// Created by Markus Müller on 22.12.08. | |
// Copyright 2008 Markus Müller. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@class MNDocumentReference; |
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
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
webView.delegate = self; | |
webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin; | |
NSURL *htmlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"]isDirectory:NO]; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); | |
dispatch_async(queue, ^{ | |
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
// This would be inserted somewhere in your app-wide tableviewcontroller superclass configuration, to reap the benefits across all subsequent tables. | |
self.tableController.heightForHeaderInSection = 22; | |
self.tableController.onViewForHeaderInSection = ^UIView*(NSUInteger sectionIndex, NSString* sectionTitle) { | |
UIView* headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.bounds.size.width, 22)] autorelease]; | |
headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sectionheader_bg.png"]]; | |
UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, self.tableView.bounds.size.width, 22)]; | |
label.text = sectionTitle; | |
label.textColor = [UIColor whiteColor]; | |
label.backgroundColor = [UIColor clearColor]; | |
label.font = [UIFont boldSystemFontOfSize:12]; |
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
/** Open States API - Data for all state legislatures (well, 38 states so far) | |
* API documentation, method listing, and example GISTs at: | |
* http://openstates.sunlightlabs.com/api/ | |
* | |
* Base URL = http://openstates.sunlightlabs.com/api/v1 | |
* NOTE: All GET requests to this base URL must include an 'apikey' query parameter. | |
* | |
* My API key looks like this "/districts/tx?apikey=350284d0c6af453b9b56f6c1c7fea1f9" | |
* | |
* Resource Path Examples: |
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
/* | |
File: KeychainItemWrapper.h | |
Abstract: | |
Objective-C wrapper for accessing a single keychain item. | |
Version: 1.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of |