Skip to content

Instantly share code, notes, and snippets.

View jakemarsh's full-sized avatar

Jake Marsh jakemarsh

View GitHub Profile
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <CoreVideo/CoreVideo.h>
#import <CoreMedia/CoreMedia.h>
/*!
@class AVController
@author Benjamin Loulier
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
fb -[NSException raise]
fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
define NSZombies
this will give you help messages. Set to NO to turn them off.
set env MallocHelp=YES
# might also be set in launch arguments.
set env NSAutoreleaseFreedObjectCheckEnabled=YES
@jakemarsh
jakemarsh / install.markdown
Created September 12, 2010 16:37 — forked from soffes/install.markdown
What I do after I do a fresh install. Things are sorta grouped by type.

New Machine

What I do after I do a fresh install. Things are sorta grouped by type.

General Config

  1. Start downloading Xcode
  2. Disable auto-bright and turn brightness all the way up
  3. Turn up trackpad tracking
  4. Disable trackpad pinch open & close
@jakemarsh
jakemarsh / gist:592329
Created September 22, 2010 19:28
Throw this on your UITableViewDelegate (probably your UITableViewController) to achieve the "keyboard dismisses when I tap away" effect.
//Throw this on your UITableViewDelegate (probably your UITableViewController) to achieve the "keyboard dismisses when I tap away" effect.
//Your users will thank you. A lot.
- (void) scrollViewWillBeginDragging:(UIScrollView *)scrollView {
[self.view endEditing:YES];
}
//The endEditing: method on UIView comes to us from a category that UITextField adds to UIKit that makes the view or any subview that is the first responder resign (optionally force), that's what the "YES" bit is.
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"PKScan" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"scanTimestamp" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
#import <Foundation/Foundation.h>
@interface NSDate (PrettySectionHeaderAdditions)
- (NSString *) prettySectionHeaderDateSring;
@end
@implementation NSDate (PrettySectionHeaderAdditions)
[oldBlog release];
JMBlog *newBlog = [[JMBlog alloc] initWithAwesomeLevel:JMAwesomeLevelLegendary];
<Response>
<Product>
<Title>Toothbrush ABC</Title>
<Image>http://www.acme.com/pic1.jpg</Image>
<Image>http://www.acme.com/pic2.jpg</Image>
<Image>http://www.acme.com/pic3.jpg</Image>
</Product>
<Offers>
<Offer>
<Merchant>ACME</Merchant>
@jakemarsh
jakemarsh / BestClassEver.m
Created February 12, 2011 04:12
The simplest thing makes a word of difference
//Author: https://github.com/TouchCode
//Code File: https://github.com/TouchCode/TouchUI/blob/master/Source/Views/CBetterAlertView.m
#import <UIKit/UIKit.h>
@interface CBetterAlertView : UIAlertView {
id userInfo;
}
@property (readwrite, nonatomic, retain) id userInfo;