Skip to content

Instantly share code, notes, and snippets.

View stuartcarnie's full-sized avatar

Stuart Carnie stuartcarnie

View GitHub Profile
@stuartcarnie
stuartcarnie / main.m
Created March 4, 2011 19:59
Demonstrates we can now support limited JIT compilation on recent versions of iOS (assuming Apple approves entitlements at some future point)
//
// main.m
// ProtectTest
// Demonstrates newer versions of iOS now support PROT_EXEC pages, for just-in-time compilation.
//
// Must be compiled with Thumb disabled
//
// Created by Stuart Carnie on 3/4/11.
// Copyright 2011 Manomio LLC. All rights reserved.
//
@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>