Skip to content

Instantly share code, notes, and snippets.

View joekr's full-sized avatar
💭
setting my status ...

Joe Kratzat joekr

💭
setting my status ...
View GitHub Profile
@joekr
joekr / .gitignore
Created August 16, 2013 16:52 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@joekr
joekr / DataController.h
Last active December 10, 2015 10:38
Subscription With Block
@interface DataController : NSObject
- (void) getSubscriptionFromServer onComplete:(void (^)(void)) completionBlock
onCancelled:(void (^)(void)) cancelBlock;
@end
@joekr
joekr / DataController.m
Last active December 10, 2015 10:43
Subscription With NSNotifications
- (void) getSubscriptionFromServer {
// call out to server
if(success == ture){
[[NSNotificationCenter defaultCenter] postNotificationName:@"getSubscriptionFromServerPassed" object:nil];
} else{
[[NSNotificationCenter defaultCenter] postNotificationName:@"getSubscriptionFromServerFailed" object:nil];
}
}
@joekr
joekr / index.html.haml_spec.rb
Created December 12, 2012 04:46
Simple referral rspecs
require 'spec_helper'
describe "ad_spots/index" do
before(:each) do
assign(:ad_spots, [
stub_model(AdSpot),
stub_model(User)
])
end
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@joekr
joekr / ShortList.m
Created January 18, 2012 15:41
NSFetchedResultsController didChangeObject is using wrong indexPath after sorting
- (void)sortShortListUsingSelectedSortIndex{
NSManagedObjectContext *context = [[AppDelegateiPad ad] managedObjectContext];
NSFetchRequest *shortListRequest = [[NSFetchRequest alloc] init];
[shortListRequest setEntity:[NSEntityDescription entityForName:@"Hip" inManagedObjectContext:context]];
[shortListRequest setPredicate:[NSPredicate predicateWithFormat:@"%@ IN shortLists", self.shortList]];
[NSFetchedResultsController deleteCacheWithName:nil];
if(selectedSortIndex == 0){
[shortListRequest setSortDescriptors:[NSArray arrayWithObjects:[NSSortDescriptor sortDescriptorWithKey:@"number" ascending:YES], nil]];
}else{