This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xcodebuild do |x| | |
| x.name = "LROAuth2Client" | |
| x.prefix = "lib" | |
| x.build_dir = "build" | |
| scheme :device do |t| | |
| t.target = "#{x.name}-Device" | |
| t.configuration = "Release" | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LRRestyRequestMultipartFormData *multipart = [[LRRestyRequestMultipartFormData alloc] init]; | |
| [multipart addPart:^(LRRestyRequestMultipartPart *part) { | |
| part.name = @"upload"; | |
| part.fileName = @"My holiday.jpg" | |
| part.contentType = @"image/jpeg"; | |
| part.data = UIImageJpegRepresentation(myImage); | |
| }]; | |
| [multipart addPart:^(LRRestyRequestMultipartPart *part) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SMSTester | |
| def initialize | |
| @number_of_sms = 0 | |
| @number_expected = 0 | |
| end | |
| def should_have_received_message_containing | |
| @number_expected += 1 | |
| # do something that might send an SMS | |
| @number_of_sms_sent += # introspect this somehow? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BetaBuilder::Tasks.new do |config| | |
| config.target = "MyApp" | |
| config.configuration = "Adhoc" | |
| config.deploy_to = "http://mywebsite/betas/" | |
| end | |
| # rake beta:build | |
| # rake beta:package | |
| # rake beta:deploy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation UIView (extensions) | |
| - (void)bringToFrontOfWindow | |
| { | |
| [[self window] bringSubviewToFront:self]; | |
| } | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| SECONDS_IN_DAY = (24*60*60) | |
| REPORT_ROOT = File.expand_path("~/Documents/Business/Accounts/iTunes Finance Reports") | |
| # I group US and WW on the same invoice as they are both in USD | |
| INVOICE_GROUPS = [%w{AU}, %w{CA}, %w{GB}, %w{EU}, %w{US WW}, %w{JP}] | |
| one_month_ago = Time.now - (30 * SECONDS_IN_DAY) | |
| # My "fetch_finance_reports" script puts reports in a sub-dir e.g. 2010-09-Aug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_3_2 | |
| BOOL MultiTaskingIsSupported() { | |
| UIDevice* device = [UIDevice currentDevice]; | |
| BOOL backgroundSupported = NO; | |
| if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { | |
| backgroundSupported = device.multitaskingSupported; | |
| } | |
| return backgroundSupported; | |
| } | |
| #else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > @lukeredpath i *always* get that black screen. i simply type my password to unlock and i have my session back! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)testCanPerformGetRequestToResourceAndExtractTheResponseAsAString | |
| { | |
| mimicGET(@"/simple/resource", andReturnBody(@"plain text response"), ^{ | |
| [client get:resourceWithPath(@"/simple/resource") delegate:self]; | |
| }); | |
| assertEventuallyThat(&lastResponse, is(responseWithStatusAndBody(200, @"plain text response"))); | |
| } | |
| - (void)testCanPostStringToResourceAndHaveThatValueEchoedBack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (LRRestyResponse *)get:(NSString *)urlString; | |
| { | |
| __block LRRestyResponse *response = nil; | |
| [self get:urlString withBlock:^(LRRestyResponse *theResponse) { | |
| response = [theResponse retain]; | |
| }]; | |
| while (response == nil) { | |
| [[NSRunLoop currentRunLoop] runForTimeInterval:0.1]; |