Skip to content

Instantly share code, notes, and snippets.

View stuartervine's full-sized avatar

Stuart Ervine stuartervine

  • Shift F6 Ltd
  • London
View GitHub Profile
@stuartervine
stuartervine / gist:4994292
Created February 20, 2013 09:36
Should argument check fail using a normal constructor, doesn't with Typhoon framework
- (id)weatherReportController
{
return [TyphoonDefinition withClass:[PFWeatherReportViewController class] initialization:^(TyphoonInitializer* initializer)
{
initializer.selector = @selector(initWithWeatherClient:weatherReportDao:cityDao:);
[initializer injectWithDefinition:[self weatherClient]];
[initializer injectWithDefinition:[self weatherReportDao]];
}];
}
@stuartervine
stuartervine / gist:4994273
Created February 20, 2013 09:31
Should type check fail using a normal constructor, doesn't with Typhoon framework
- (id)weatherReportController
{
return [TyphoonDefinition withClass:[PFWeatherReportViewController class] initialization:^(TyphoonInitializer* initializer)
{
initializer.selector = @selector(initWithWeatherClient:weatherReportDao:cityDao:);
[initializer injectWithDefinition:[self weatherClient]];
[initializer injectWithDefinition:[self weatherReportDao]];
[initializer injectWithDefinition:[self weatherReportDao]];
}];
}
@stuartervine
stuartervine / gist:2145524
Created March 21, 2012 07:52
Mark Needhams option example
-(Option *)calculate:(Option *)base increment:(Option *)incrementer multiplier:(int)multiplier {
Option *multiplied = [incrementer map:TL_multiplyBy(multiplier)];
return [Option option:[[sequence(base, multiplied, nil) flatten] reduce:TL_sum()]];
}
@stuartervine
stuartervine / file1.txt
Created March 20, 2012 23:17
Run build script
./build.sh
@stuartervine
stuartervine / file1.txt
Created March 20, 2012 23:16
Change shell script permissions
chmod +x build.sh
@stuartervine
stuartervine / file1.sh
Created March 20, 2012 23:14
Awesome App build script
#!/bin/sh
xcodebuild -target AwesomeApp -sdk iphonesimulator -configuration Release build;
@stuartervine
stuartervine / file1.txt
Created March 20, 2012 23:12
Awesome App build release
cd <project-root>
xcodebuild -target AwesomeApp -sdk iphonesimulator -configuration Release build;
@stuartervine
stuartervine / file1.txt
Created March 20, 2012 23:11
awesome app debug build
cd <project-root>
xcodebuild -target AwesomeApp -sdk iphonesimulator -configuration Debug build;
@stuartervine
stuartervine / file1.txt
Created March 20, 2012 22:51
xcodebuild man page
xcodebuild [-project projectname] [-target targetname ...]
[-configuration configurationname]
[-sdk [sdkfullpath | sdkname]] [buildaction ...]
[setting=value ...] [-userdefault=value ...]
xcodebuild -workspace workspacename -scheme schemename
[-configuration configurationname]
[-sdk [sdkfullpath | sdkname]] [buildaction ...]
[setting=value ...] [-userdefault=value ...]
xcodebuild -version [-sdk [sdkfullpath | sdkname]] [infoitem]
xcodebuild -showsdks