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
| # Redis configuration file example | |
| #slaveof 10.12.86.71 6379 | |
| daemonize yes | |
| pidfile /ec/var/redis/redis_6379.pid | |
| timeout 300 | |
| loglevel notice | |
| logfile /home/audioboo/logs/redis_6379.log |
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
| diff --git a/app/assets/javascripts/extras/embed_editor.js.erb b/app/assets/javascripts/extras/embed_editor.js.erb | |
| index 4f6b4e9..79aecf4 100644 | |
| --- a/app/assets/javascripts/extras/embed_editor.js.erb | |
| +++ b/app/assets/javascripts/extras/embed_editor.js.erb | |
| @@ -321,6 +338,7 @@ | |
| return this.theme == 'light' ? this.lightLinkColor : this.darkLinkColor; | |
| } | |
| this.setLinkColor = function( colorName ) { | |
| + this.setUseCustomColor(false); | |
| var f = this.theme == 'light' ? this.setLightLinkColor : this.setDarkLinkColor; |
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
| id UIFieldEditor = NSClassFromString(@"UIFieldEditor"); | |
| if ([UIFieldEditor respondsToSelector:@selector(sharedFieldEditor)]) { | |
| [UIFieldEditor performSelector:@selector(sharedFieldEditor)]; | |
| } |
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
| NSArray* inputURLs = @[[NSURL fileURLWithPath:@"/Users/jon/Desktop/welcome.caf"], [NSURL fileURLWithPath:@"/Users/jon/Desktop/welcome.caf"]]; | |
| NSError* error=nil; | |
| AVMutableComposition* composition = [AVMutableComposition composition]; | |
| for(NSURL* url in inputURLs) { | |
| AVMutableCompositionTrack* track = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; | |
| AVURLAsset* asset = [AVURLAsset assetWithURL:url]; | |
| NSArray* assetTracks = [asset tracksWithMediaType:AVMediaTypeAudio]; | |
| AVAssetTrack* assetTrack = assetTracks[0]; | |
| [track insertTimeRange:assetTrack.timeRange ofTrack:assetTrack atTime:composition.duration error:&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
| // In a UIView subclass: | |
| @interface MySlider | |
| @property CGFloat min, max; | |
| @end | |
| @implementation MySlider | |
| -(void)setMin:(CGFloat)value { | |
| _min = value; | |
| [self setNeedsDisplay]; | |
| } | |
| -(void)setMax:(CGFloat)value { |
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
| +(MySingleton*)sharedSingleton { | |
| static MySingleton *sharedSingleton=nil; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| sharedSingleton = [[self alloc] init]; | |
| }); | |
| return sharedSingleton; | |
| } |
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
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
| id result = [self doSomethingSlow]; | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| [self doSomethingToTableviewWithResult:result] | |
| }); | |
| }); |
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)encodeRestorableStateWithCoder:(NSCoder *)coder { | |
| NSAssert(self.navController.viewControllers[0] == self.baseController, @"WTF"); // passes | |
| [coder encodeObject:self.navController forKey:@"navController"]; | |
| [coder encodeObject:self.baseController forKey:@"baseController"]; | |
| [super encodeRestorableStateWithCoder:coder]; | |
| } | |
| - (void) decodeRestorableStateWithCoder:(NSCoder *)coder { | |
| [super decodeRestorableStateWithCoder:coder]; |
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
| get 'foo/a'=>'users#edit', defaults:{bar:1} | |
| get 'foo/b'=>'users#edit', defaults:{bar:2} | |
| get 'foo/c'=>'users#edit', defaults:{bar:3} |
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
| it "receive_message_chain allows inline return values" do | |
| object = double('hi') | |
| allow(object).to receive_message_chain(:msg1, :msg2 => :return_value) | |
| expect { | |
| object.msg1("nonsense", :value).msg2("another", :nonsense, 3.0, "value") | |
| }.not_to raise_error | |
| end |