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
NSString *NSStringFromOSStatus(OSStatus errCode) | |
{ | |
if (errCode == noErr) | |
return @"noErr"; | |
char message[5] = {0}; | |
*(UInt32*) message = CFSwapInt32HostToBig(errCode); | |
return [NSString stringWithCString:message encoding:NSASCIIStringEncoding]; | |
} |
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 AVAssetExportSession (Testing) | |
- (void) exportSynchronously | |
{ | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
[self exportAsynchronouslyWithCompletionHandler:^{ | |
dispatch_semaphore_signal(semaphore); | |
}]; | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
dispatch_release(semaphore); |
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
// Runs given block. Returns YES if some object of class ‘c’ | |
// was deallocated in the block. Not thread-safe. | |
BOOL classGetsDeallocated(Class c, void (^block)(void)); | |
// Convenience interface that calls the function above. | |
// Releases object, returns YES if object was deallocated. | |
BOOL getsDeallocatedByReleasing(id object); |
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 Foo : NSObject {} | |
@property(assign) float foo; | |
@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 perl | |
use Modern::Perl; | |
use HTTP::Proxy; | |
use HTTP::Proxy::HeaderFilter::simple; | |
my $proxy = HTTP::Proxy->new(host => undef, port => 3128); | |
my $filter = HTTP::Proxy::HeaderFilter::simple->new(sub | |
{ | |
my ($self, $headers, $message) = @_; |
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
#import "Foo.h" | |
// Private Foo interface. The IBOutlet will get picked up by Interface Builder! | |
@interface Foo () | |
@property(strong) IBOutlet UIView *someView; | |
@end | |
@implementation Foo | |
@synthesize someView; | |
… |
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
begin | |
require 'terminal-notifier' | |
module Jekyll | |
class Site | |
alias jekyll_process process | |
def process | |
jekyll_process | |
TerminalNotifier.notify('Jekyll rebuild finished.') | |
end | |
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
# Based on http://hack.swic.name/automated-xcode-6-bot-testflight-uploads/ | |
API_TOKEN="XXX" | |
APP_ID="XXX" | |
upload() { | |
BASE_PATH="/Library/Developer/XcodeServer/IntegrationAssets/" | |
IPA="${BASE_PATH}${XCS_BOT_ID}-${XCS_BOT_NAME}/${XCS_INTEGRATION_NUMBER}/${XCS_BOT_NAME}.ipa" | |
ARCHIVE="${BASE_PATH}${XCS_BOT_ID}-${XCS_BOT_NAME}/${XCS_INTEGRATION_NUMBER}/Archive.xcarchive.zip" | |
DSYM_ZIP="/tmp/dSYM.zip" |
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
# Based on http://hack.swic.name/automated-xcode-6-bot-testflight-uploads/ | |
API_TOKEN="XXX" | |
APP_ID="XXX" | |
upload() { | |
BASE_PATH="/Library/Developer/XcodeServer/IntegrationAssets/" | |
ARCHIVE="${BASE_PATH}${XCS_BOT_ID}-${XCS_BOT_NAME}/${XCS_INTEGRATION_NUMBER}/Archive.xcarchive.zip" | |
APP_ZIP="/tmp/app.zip" | |
DSYM_ZIP="/tmp/dSYM.zip" |
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 perl | |
use v5.14; | |
use strict; | |
use warnings; | |
use Data::Dump 'pp'; | |
{ | |
package Node; | |
use Mouse; |