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
DOMAIN = 'media_player' | |
REQUIREMENTS = ['jvc_tools==0.1.3'] | |
import logging | |
import voluptuous as vol | |
from homeassistant.helpers.entity import ToggleEntity | |
_LOGGER = logging.getLogger(__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
platform :ios, :deployment_target=>"6.0" | |
inhibit_all_warnings! | |
target :todayGHTests, :exclusive => true do | |
link_with 'todayGHUnitTests' | |
pod 'Specta' | |
pod 'OCHamcrest' | |
pod 'Expecta', :git=>'[email protected]:blackgold9/expecta.git' | |
pod 'OCMock' | |
pod 'GHUnitIOS' |
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
Ld /Users/svanter/Library/Developer/Xcode/DerivedData/Today-fwbocoigxhinoqcjapbfvowxhzwp/Build/Products/Debug-iphoneos/todayGHUnitTests.app/todayGHUnitTests normal armv7 | |
cd /Users/svanter/git/iOS-TodayApp/Today | |
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1 | |
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/svanter/Library/Developer/Xcode/DerivedData/Today-fwbocoigxhinoqcjapbfvowxhzwp/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system -F/Users/svanter/Library/Developer/Xcode/DerivedData/Today-fwbocoigxhinoqcjapbfvowxhzwp/Build/Products/Debug-iphoneos -F/ |
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
static dispatch_queue_t af_image_request_operation_processing_queue; | |
static dispatch_queue_t image_request_operation_processing_queue() { | |
if (af_image_request_operation_processing_queue == NULL) { | |
af_image_request_operation_processing_queue = dispatch_queue_create("com.alamofire.networking.image-request.processing", 0); | |
dispatch_set_target_queue(af_image_request_operation_processing_queue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)); | |
} | |
return af_image_request_operation_processing_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
- (void)contextWillSave:(NSNotification *)notification | |
{ | |
NSManagedObjectContext *context = (NSManagedObjectContext *)notification.object; | |
if (context.insertedObjects.count > 0) { | |
NSArray *insertedObjects = [[context insertedObjects] allObjects]; | |
MRLog(@"Context %@ is about to save. Obtaining permanent IDs for new %lu inserted objects", [context MR_description], (unsigned long)[insertedObjects count]); | |
__autoreleasing NSError *error = nil; | |
BOOL success = [context obtainPermanentIDsForObjects:insertedObjects error:&error]; | |
if (!success && error) { | |
[MagicalRecord handleErrors:error]; |
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
- (id) MR_inContext:(NSManagedObjectContext *)otherContext | |
{ | |
__block NSError *error; | |
if ([self.objectID isTemporaryID]) { | |
if (otherContext.parentContext == self.managedObjectContext) | |
{ | |
// We have a temporary id, which can never be used to lookup accross contexts, but we're trying it from a child context, so we can just get it | |
[self.managedObjectContext performBlockAndWait:^{ | |
MRLog(@"Automatically obtaining a permanent Id so we can find it in a child context"); | |
[self.managedObjectContext obtainPermanentIDsForObjects:[NSArray arrayWithObject:self] error:nil]; |
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) enqueueOperation:(MKNetworkOperation*) operation forceReload:(BOOL) forceReload { | |
dispatch_queue_t originalQueue = dispatch_get_current_queue(); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
[operation setCacheHandler:^(MKNetworkOperation* completedCacheableOperation) { | |
// if this is not called, the request would have been a non cacheable request | |
//completedCacheableOperation.cacheHeaders; | |
NSString *uniqueId = [completedCacheableOperation uniqueIdentifier]; | |
[self saveCacheData:[completedCacheableOperation responseData] | |
forKey:uniqueId]; |
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
NSURL *imageURL = [NSURL URLWithString:[podcast logoURL]]; | |
[[SVPodcatcherClient sharedInstance] imageAtURL:imageURL | |
onCompletion:^(UIImage *fetchedImage, NSURL *url, BOOL isInCache) { | |
if ([[url absoluteString] isEqualToString:[imageURL absoluteString]]) { | |
if(!isInCache) { | |
CATransition *transition = [CATransition animation]; | |
[self.logoImageView.layer addAnimation:transition forKey:nil]; | |
} |
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
diff --git a/Support/lib/spec/mate.rb b/Support/lib/spec/mate.rb | |
index 6d0ce89..b634303 100644 | |
--- a/Support/lib/spec/mate.rb | |
+++ b/Support/lib/spec/mate.rb | |
@@ -1,18 +1,18 @@ | |
# This is based on Florian Weber's TDDMate | |
require 'rubygems' | |
+# Load spec/autorun | |
ENV['TM_PROJECT_DIRECTORY'] ||= File.dirname(ENV['TM_FILEPATH']) |
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
module CanCan | |
# This module is automatically included into all Mongoid | |
module MongoidAdditions | |
module ClassMethods | |
# Returns a scope which fetches only the records that the passed ability | |
# can perform a given action on. The action defaults to :read. This | |
# is usually called from a controller and passed the +current_ability+. | |
# | |
# @articles = Article.accessible_by(current_ability) | |
# |