This file contains 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
# Remove 64-bit build architecture from Pods targets | |
# http://cameronspickert.com/2014/01/20/remove-the-arm64-architecture-from-cocoapods-targets.html | |
post_install do |installer| | |
installer.project.targets.each do |target| | |
target.build_configurations.each do |configuration| | |
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)' | |
end | |
end | |
end |
This file contains 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
on alfred_script(q) | |
tell application "Mail" | |
activate | |
-- Accounts | |
set AnL to account "A&L" | |
set GMail to account "GMail" | |
set FastMail to account "FastMail" | |
-- Personal Email |
This file contains 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
{ | |
"this": "succeeded", | |
"by": "dweeting", | |
"the": "dweet", | |
"with": { | |
"thing": "{thing_name}", | |
"created": "2014-01-15T17:28:42.556Z", | |
"content": { | |
"hello": "world", | |
"foo": "bar" |
This file contains 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)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context | |
{ | |
if ([keyPath isEqualToString:@"status"]) | |
{ | |
if (AVPlayerItemStatusReadyToPlay == _player.currentItem.status) | |
{ | |
[_player play]; | |
} | |
} | |
} |
This file contains 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
// Action for our 4 sliders | |
- (IBAction)mix:(id)sender | |
{ | |
UISlider* slider = (UISlider*)sender; | |
[self setVolume:slider.value | |
forTrack:[NSString stringWithFormat:@"track%d", slider.tag]]; | |
[self applyAudioMix]; | |
} |
This file contains 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
// Set the volumne (0.0 - 1.0) for the given track | |
- (void)setVolume:(float)volume forTrack:(NSString*)audioTrackName | |
{ | |
[_audioMixValues setValue:[NSNumber numberWithFloat:volume] forKey:audioTrackName]; | |
} |
This file contains 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
// Build and apply an audio mix using our volume values | |
- (void)applyAudioMix | |
{ | |
AVMutableAudioMix* mix = [AVMutableAudioMix audioMix]; | |
NSMutableArray* inputParameters = [[NSMutableArray alloc] initWithCapacity:0]; | |
[_audioMixTrackIDs enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL*stop) { | |
AVAssetTrack* track = [self trackWithId:(CMPersistentTrackID)[(NSNumber*)obj integerValue]]; | |
This file contains 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 CBCosmDatastream | |
#pragma mark - Mantle | |
+ (NSDictionary *)externalRepresentationKeyPathsByPropertyKey | |
{ | |
return [super.externalRepresentationKeyPathsByPropertyKey mtl_dictionaryByAddingEntriesFromDictionary:@{ | |
@"datastreamId": @"id", | |
@"updated": @"at", | |
@"value": @"current_value", |
This file contains 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 CBCosmDatastream | |
- (id)initWithAttributes:(NSDictionary*)attributes | |
{ | |
self = [super init]; | |
if (self) | |
{ | |
if (!attributes) | |
{ |
This file contains 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
NSArray *cars = [@"Testarossa", @"F50", @"F458 Italia"]; | |
// or NSSet *cars = [NSSet setWithObjects:@"Testarossa", @"F50", @"F458 Italia", nil]; | |
[cars map:^id(id car){ | |
return @([[car substringToIndex:1] isEqualToString:@"F"]); | |
}]; | |
// NO (Testarossa) | |
// YES (F50) | |
// YES (F458 Italia) |
OlderNewer