Skip to content

Instantly share code, notes, and snippets.

View mbbischoff's full-sized avatar
🏳️‍⚧️

mb mbbischoff

🏳️‍⚧️
View GitHub Profile
@mbbischoff
mbbischoff / Quotebook URL Scheme.md
Created March 5, 2012 04:28
Quotebook 2.0 URL Scheme

General Navigation

  • quotebook:// — Opens the app
  • quotebook://quotes — Goes to the Quotes Tab
  • quotebook://authors — Goes to the Authors Tab
  • quotebook://sources — Goes to the Sources Tab
  • quotebook://tags — Goes to the Tags tab

Adding Quotes

  • quotebook://add?quote=Stay%20Hungry.%20Stay%20Foolish.&author=Steve%20Jobs&source=Whole%20Earth%20Catalog&rating=5
  • Adds a quote "Stay Hungry. Stay foolish." to the user's Quotebook with the author Steve Jobs, the source Whole Earth Catalog with a rating of 5 stars.
// Run this in the viewDidLoad of a new Core Data project with the Master-Detail Application Template
// Replace the file name with your momd's filename.
- (void)testCoreDataEquality {
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"TestCoreDataISEqual" withExtension:@"momd"];
NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
NSPersistentStoreCoordinator *storeCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
[storeCoordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil];
NSManagedObjectContext *mainQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
@mbbischoff
mbbischoff / UITextField+LCKHacks.h
Created December 1, 2013 00:22
Used instead of `hasText` due to an inscrutable bug in iOS 7.
#import <UIKit/UIKit.h>
@interface UITextField (LCKHacks)
/// Fixes a bug in UIKit where the `hasText` methods sometimes returns the string's length instead of a BOOL in iOS 7.0.x.
- (BOOL)actuallyHasText;
@end
@mbbischoff
mbbischoff / TMDashboardViewController.m
Created January 31, 2014 02:48
Receive UIKeyCommands without a text view or text field as the first responder.
@implementation TMDashboardViewController
#pragma mark - UIResponder
- (BOOL)canBecomeFirstResponder {
return YES;
}
- (NSArray *)keyCommands {
static NSArray *keyCommands;
<?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>%d messages in your inbox</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@messages@ in your inbox</string>
<key>messages</key>
<dict>
//
// LCKAlertPresenter.h
// Quotebook
//
// Created by Matthew Bischoff on 9/1/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import Foundation;

Keybase proof

I hereby claim:

  • I am mattbischoff on github.
  • I am matthewbischoff (https://keybase.io/matthewbischoff) on keybase.
  • I have a public key whose fingerprint is EECC 1F2E 27A9 2D5D 29F2 1E33 09F3 0AD2 B628 A4CD

To claim this, I am signing this object:

@mbbischoff
mbbischoff / LCKIndexedFetchedResultsController.h
Last active August 29, 2015 14:10
LCKIndexedFetchedResultsController is a NSFetchedResultsController subclass that attempts to solve the problem of sorting a fetched collection into correctly alphabetized sections for every locale. It does things like making sure that the `#` character shows up at the bottom instead of the top of the section index titles.
//
// LCKIndexedFetchedResultsController.h
// Quotebook
//
// Created by Andrew Harrison on 7/26/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import CoreData;
//
// LCKConcurrentOperation.h
// LCKOperations
//
// Created by Twig on 12/19/13.
// Copyright (c) 2013 Lickability. All rights reserved.
//
@import Foundation;
@mbbischoff
mbbischoff / FetchedResultsControllerTableViewDataSource.h
Last active August 29, 2015 14:15
FetchedResultsControllerTableViewDataSource. Please stop writing this over and over again.
//
// FetchedResultsControllerTableViewDataSource.h
// Flock
//
// Created by Matthew Bischoff on 2/14/15.
// Copyright (c) 2015 Lickability. All rights reserved.
//
@import Foundation;
@import CoreData;