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
RACSignal *signal = [[[[[SomeClient clientForAccount:account] enqueueHTTPRequestWithMethod:@"GET" path:path parameters:nil] | |
flattenMap:^(id responseObject) { | |
NSMutableArray *signals = [NSMutableArray array]; | |
[signals addObject:[SomeClient fetchEditmetaForItems:[NSSet setWithObject:item] account:account]]; | |
[signals addObject:[SomeClient fetchTransitionsForItem:item]]; | |
return [signals.rac_sequence.signal flatten:1]; | |
}] |
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
int main(int argc, const char *argv[]) { | |
NSXPCListener *serviceListener = [NSXPCListener serviceListener]; | |
#ifndef DEBUG | |
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"<IDENTIFIER>" delegate:nil]; | |
[[BITHockeyManager sharedHockeyManager] setDisableFeedbackManager:YES]; | |
[[BITHockeyManager sharedHockeyManager].crashManager setAskUserDetails:NO]; | |
[[BITHockeyManager sharedHockeyManager].crashManager setAutoSubmitCrashReport:YES]; | |
[[BITHockeyManager sharedHockeyManager] startManager]; | |
#endif |
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
Whitespace ::= ' ' | |
Period ::= '.' | |
ItemPrefix ::= 'Digit'<Period> | '-' | |
ItemContent ::= 'String' | |
Checkbox ::= '[ ]' | '[x]' | |
Item ::= <ItemPrefix> <Whitespace>{1} <Checkbox> <Whitespace>+ <ItemContent> |
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
RACScheduler* bee_plugin_rac_scheduler(void) { | |
static RACQueueScheduler *b_rac_scheduler; | |
if (b_rac_scheduler == NULL) { | |
static dispatch_once_t oncePredicate; | |
dispatch_once(&oncePredicate, ^{ | |
b_rac_scheduler = [[RACQueueScheduler alloc] initWithName:@"io.neat.Bee.rac-scheduler" queue:bee_plugin_queue()]; | |
}); | |
} | |
return b_rac_scheduler; |
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
- (RACSignal *)enqueueHTTPRequestWithRequest:(NSURLRequest *)request { | |
RACScheduler *scheduler = bee_plugin_rac_scheduler(); | |
RACSignal *requestSignal = [[RACSignal createSignal:^(id<RACSubscriber> subscriber) { | |
AFHTTPRequestOperation *requestOperation = [self HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
[subscriber sendNext:responseObject]; | |
[subscriber sendCompleted]; | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
[subscriber sendError:error]; | |
}]; |
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
NSMutableURLRequest *request = [client multipartFormRequestWithMethod:@"POST" path:path parameters:nil constructingBodyWithBlock:^(id <AFMultipartFormData> formData) { | |
[formData appendPartWithFileData:data | |
name:@"file" | |
fileName:attachmentName | |
mimeType:attachmentMIMEType]; | |
}]; |
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
#!/bin/bash | |
# This script automatically sets the version and short version string of | |
# an Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode 4, add the contents to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset |
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
@interface NSView (Layout) | |
- (void)setNeedsSubviewLayout; | |
@end | |
@implementation NSView (Layout) | |
- (void)setNeedsSubviewLayout { |
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
float screenResolution() { | |
struct utsname systemInfo; | |
uname(&systemInfo); | |
char *name = systemInfo.machine; | |
float ppi; | |
if ((strstr(name, "iPod") != NULL) && (strstr(name, "iPod4") == NULL)) { | |
// older ipod touches | |
ppi = 163; | |
} else if ((strstr(name, "iPhone") != NULL) && (strstr(name, "iPhone3") == NULL)) { |