Skip to content

Instantly share code, notes, and snippets.

View natelyman's full-sized avatar

Nate Lyman natelyman

View GitHub Profile
@natelyman
natelyman / gist:6175268
Created August 7, 2013 15:43
Kill the old core data file if invalidated.
// Returns the persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. (The directory for the store is created, if necessary.)
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
if (_persistentStoreCoordinator) {
return _persistentStoreCoordinator;
}
NSManagedObjectModel *mom = [self managedObjectModel];
if (!mom) {
NSLog(@"%@:%@ No model to generate a store from", [self class], NSStringFromSelector(_cmd));
@natelyman
natelyman / gist:5978475
Created July 11, 2013 19:29
Changing Content-Type in S3 with Python
#!/usr/bin/env python
aws_access_key = "" # Your AWS Access Key
aws_secret_key = "" # Your AWS Secret Key
bucket_name = "" # Your Bucket Name
import os as os
import mimetypes
from boto.s3.connection import S3Connection
@natelyman
natelyman / NLCachedImageTableViewCell.h
Created January 9, 2012 10:16
Cached UITableViewCell that loads images from a remote source.
//
// NLCachedImageTableViewCell.h
// niners
//
// Created by Lyman, Nathan(nlyman) on 1/9/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>