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
(ns com.atomicobject.state | |
(def ^:private config-file* (ref nil)) | |
(defn config-file [] (@config-file*)) | |
(defn set-config-file! [new-config] | |
{:pre? [(string? new-config)]} | |
(dosync | |
(ref-set config-file new-config))) |
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
(ns com.atomicobject.config | |
(defn with-config-fn [config-file] (fn [] config-file))) | |
(defn -main [& args] | |
(let [{:keys [config] inputs}] (cli args ["--config" "Config file"]) | |
(def config-file (with-config-fn config)))) |
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
(ns com.atomicobject.config | |
(def ^:private config-file* (ref nil)) | |
(defn config-file [] (@config-file*)) | |
(defn set-config-file! [new-config] | |
{:pre? [(string? new-config)]} | |
(dosync | |
(ref-set config-file new-config)))) |
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
# | |
# Lighting | |
# | |
lighting | |
.turnOn() | |
.adjustLightingBy(value) | |
.onFailure(=> tellTheUserWeHadTroubleAdjustingTheLighting()) | |
# |
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
# | |
# Lighting | |
# | |
success = connectToDevice '/dev/tty.usb1', 14400 | |
if success | |
sendToDevice "VOLTS " + volts | |
else | |
console.log "ERROR: Couldn't connect to analog voltage device" | |
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 MyClass | |
- (void)pickAMirroredRoute { | |
MPAudioDeviceController *audoDeviceController = [[MPAudioDeviceController alloc] init]; | |
audoDeviceController.routeDiscoveryEnabled = YES; | |
[audoDeviceController determinePickableRoutesWithCompletionHandler:^(NSInteger value) { | |
NSMutableArray *routes = [NSMutableArray array]; | |
[audoDeviceController clearCachedRoutes]; | |
NSUInteger index = 0; |
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
( | |
{ | |
AVAudioRouteName = Speaker; | |
AlternateUIDs = ( | |
); | |
RouteCurrentlyPicked = 1; | |
RouteName = Speaker; | |
RouteType = Default; | |
}, | |
{ |
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
// Make sure MediaPlayer.framework has been added and the MPAudioVideoRoutingPopoverController interface has been declared. | |
@interface MyViewController () | |
@property (strong, nonatomic) MPAudioVideoRoutingPopoverController *airplayPopoverController; | |
@end | |
- (void)someButtonTapped:(id)sender { | |
self.airplayPopoverController = [[MPAudioVideoRoutingPopoverController alloc] initWithType:0 includeMirroring:YES]; | |
self.airplayPopoverController.delegate = self; | |
[self.airplayPopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; |
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
Pod::Spec.new do |s| | |
config.platform :ios do | |
s.frameworks = ['CFNetwork'] | |
end | |
config.platform :osx do | |
s.frameworks = ['CoreServices'] | |
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
typedef struct _gcd_monad { | |
struct _gcd_monad* (*then)(id(^)(id)); | |
struct _gcd_monad* (*then_with_queue)(id(^)(id), dispatch_queue_t); | |
struct _gcd_monad* (*error)(id(^)(id)); | |
struct _gcd_monad* (*error_with_queue)(id(^)(id), dispatch_queue_t); | |
struct _gcd_monad* (*finally)(id(^)(id)); | |
struct _gcd_monad* (*finally_with_queue)(id(^)(id), dispatch_queue_t); | |
} gcd_monad; | |
gcd_monad * monad_dispatch(id object); |