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
// Fast Enumeration Best Techniques: | |
// Following Nick Lockwood article: http://iosdevelopertips.com/objective-c/high-performance-collection-looping-objective-c.html?utm_source=iOSDevTips&utm_campaign=wordtwit&utm_medium=twitter | |
// NSArray Fast Enumeration | |
NSMutableArray *array; | |
for (<#type *object#> in array) { | |
<#statements#> | |
} |
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
var rnd = function( to, from ) { | |
return Math.floor( Math.random() * (to - from + 1) + from ); | |
}; | |
var triggerKey = function(key) { | |
triggerKeyEvent( | |
document.getElementsByTagName('body')[0], key | |
); |
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
// | |
// EDSViewController.m | |
// MultipleCollectionViews | |
// | |
// Created by Eduardo Diaz Sancha on 3/26/14. | |
// Copyright (c) 2014 edsancha. All rights reserved. | |
// | |
#import "EDSViewController.h" | |
#import "EDSCollectionViewCell.h" |
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
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextChanged:) name:NSManagedObjectContextWillSaveNotification object:nil]; | |
-(void)contextChanged:(NSNotification *)notification { | |
for(NSManagedObject *object in [(NSManagedObjectContext *)notification.object updatedObjects]) { | |
if([object isKindOfClass:[Product class]]) { | |
id value = [object changedValues][@"value"]; | |
if (value){ | |
NSLog(@"%@",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
- (NSString *)overrideHTMLFormat:(NSString *)htmlText { | |
NSArray *tagsToOverride = @[@"body",@"b", @"a", @"td", @"span", @"p", @"div"]; | |
NSString *header = @"<head><style> "; | |
for (NSString *tag in tagsToOverride) { | |
header = [header stringByAppendingString:tag]; | |
header = [header stringByAppendingString:@" {font-family: HelveticaNeue !important; font-size: 11pt !important; line-height:18pt !important} "]; | |
} | |
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
{ | |
"data":[ | |
{ | |
"type":"projects", | |
"id":"1", | |
"relationships":{ | |
"team":{ | |
"data": { | |
"type":"teams", | |
"id":"1" |