Skip to content

Instantly share code, notes, and snippets.

View fzf's full-sized avatar

Fletcher Fowler fzf

View GitHub Profile
@fzf
fzf / nsincrementalstore.markdown
Created April 20, 2012 05:07 — forked from chriseidhof/nsincrementalstore.markdown
Accessing an API using CoreData's NSIncrementalStore

Accessing an API using CoreData's NSIncrementalStore

Note: the original location of this article is on my blog, however, it is posted here too for better readability.

In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.

@fzf
fzf / nsincrementalstore.markdown
Created May 14, 2012 06:07 — forked from chriseidhof/nsincrementalstore.markdown
Accessing an API using CoreData's NSIncrementalStore

Accessing an API using CoreData's NSIncrementalStore

Note: the original location of this article is on my blog, however, it is posted here too for better readability.

In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.

@fzf
fzf / gist:2943492
Created June 17, 2012 05:25
Sublime Text 2 Vintage Mode Clipboard History
[
{ "keys": ["Y"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
{ "keys": ["y"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
{ "keys": ["D"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
#hero
background: white url('../images/hero_bg.png') no-repeat 600px 43px
border-radius: 3px
box-shadow: 0px 1px 1px 1px #ccc
padding: 1em 1.5em 1em 1.5em
margin: 1.5em 0 0 0
h1
color: #0f4c89
font-size: 2em
ul
@fzf
fzf / gist:3977753
Created October 30, 2012 01:17
Server
//
// Server.m
// Loop
//
// Created by Fletcher Fowler on 8/19/12.
// Copyright (c) 2012 Zamboni Dev. All rights reserved.
//
#import "Server.h"
#import "SMWebRequest.h"
[objectManager postObject:[User class] path:@"/users" parameters:@{@"user" : @{@"email" : @"test@example.com", @"password" : @"password"}} success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
NSLog(@"success");
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"failure");
}];
@fzf
fzf / singletons.m
Last active December 11, 2015 05:48
Creating singletons.
+ (ClassyClass *)sharedClient
{
static Server *_sharedClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedClient = [[ClassyClass alloc] init];
});
return _sharedClient;
}
- (NSFetchedResultsController *)fetchedResultsController {
if (_fetchedResultsController != nil)
{
return _fetchedResultsController;
}
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY checkins.place = %@", self.place];
return [User MR_fetchAllGroupedBy:nil withPredicate:predicate sortedBy:nil ascending:TRUE];
}
Relationship fault for (<NSFetchedPropertyDescription: 0x89841a0>), name users, isOptional 1, isTransient 1, entity Place, renamingIdentifier users, validation predicates (
), warnings (
), versionHashModifier (null)
userInfo {
}, fetchRequest <NSFetchRequest: 0x8984470> (entity: Place; predicate: (ANY checkins.place == $FETCH_SOURCE); sortDescriptors: ((null)); type: NSManagedObjectResultType; ) on 0x89ad880
@fzf
fzf / rake routes
Last active December 11, 2015 22:29
api_v1_events GET /api/v1/events(.:format) Api::V1/events#index
events GET /events(.:format) Api::V1/events#index
GET /events(.:format) events#index