Skip to content

Instantly share code, notes, and snippets.

View stuartcarnie's full-sized avatar

Stuart Carnie stuartcarnie

View GitHub Profile
@stuartcarnie
stuartcarnie / NSObject+Blocks.h
Created April 24, 2011 16:57
Blocks category for NSObject
// credits to Matthias Plappert
#import <Foundation/Foundation.h>
@interface NSObject (PWBlocks)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
@end
@stuartcarnie
stuartcarnie / BlocksAdditions.h
Created September 8, 2010 10:01
A few Objective-C blocks additions for NSArray
@interface NSArray(BlocksAdditions)
- (NSArray*)mapUsingBlock:(id (^)(id obj))block;
- (NSSet*)mapToSetUsingBlock:(id (^)(id obj))block;
- (id)firstUsingBlock:(BOOL(^)(id obj))block;
@end
@stuartcarnie
stuartcarnie / PerfTester.h
Created January 25, 2010 06:01
Micro-benchmarks for iPhone and OS X
//
// PerfTester.h
// TollFreeBridingTests
//
// Created by Stuart Carnie on 1/24/10.
// Copyright 2010 Manomio. All rights reserved.
//
#import <Foundation/Foundation.h>