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
//Having to include so many different header files to do basic | |
//things like open a file, use strings, vectors and tuples, etc, | |
//is still annoying. | |
#include <fstream> | |
#include <vector> | |
#include <map> | |
#include <tuple> | |
#include <string> | |
//To use C++11 lambdas with Boost lambdas we define this. |
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
config defaultToCurrentScreen true | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows false | |
config windowHintsSpread true | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows false | |
# Cmd+E brings up window chooser based on alphabet | |
bind e:cmd hint ASDFGHJKLQWERTYUIOPCVBN |
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
# ====================================== | |
# The HYPER key | |
# ====================================== | |
alias hyperend shift;alt;cmd;fn | |
alias hyper shift;alt;cmd;ctrl | |
# ====================================== | |
# Application aliases | |
# ====================================== | |
alias browser 'Google Chrome' |
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
2012-12-27 12:27:35.942 DayTwentyFour[20082:c07] initWithCoder | |
2012-12-27 12:27:35.947 DayTwentyFour[20082:c07] loadView | |
2012-12-27 12:27:35.949 DayTwentyFour[20082:c07] viewDidLoad | |
2012-12-27 12:27:35.949 DayTwentyFour[20082:c07] viewWillAppear | |
2012-12-27 12:27:35.952 DayTwentyFour[20082:c07] viewWillLayoutSubviews | |
2012-12-27 12:27:35.952 DayTwentyFour[20082:c07] viewDidLayoutSubviews | |
2012-12-27 12:27:35.956 DayTwentyFour[20082:c07] viewDidAppear |
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
AsyncBlockOperation is very similar to NSBlockOperation with one caveat; the block you pass to it receives one argument, a reference to the AsyncBlockOperation for the block. When your block is done with its task, it must call [op complete] | |
Example usage: | |
NSOperation* asyncOp = [AsyncBlockOperation blockOperationWithBlock:^(AsyncBlockOperation* op) { | |
NSLog(@"starting op"); | |
double delayInSeconds = 2.0; | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ |
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
- (UIImage*)blurImage | |
{ | |
// Create our sourcePicture for processing | |
GPUImagePicture *sourcePicture = [[[GPUImagePicture alloc] initWithImage:self] autorelease]; | |
// init the fast blur filter | |
GPUImageFastBlurFilter *blurFilter = [[[GPUImageFastBlurFilter alloc] init] autorelease]; | |
// set some parameters for the fast blur | |
[blurFilter setBlurPasses:3.0f]; |
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
//viewDidload | |
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { | |
// iOS 7 | |
[self prefersStatusBarHidden]; | |
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; | |
} else { | |
// iOS 6 | |
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; | |
} |
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
CGRect OldFrame = CGRectMake(150, 150, 120, 150); | |
UIView * view = [[UIView alloc] initWithFrame:OldFrame]; | |
view.clipsToBounds = YES; | |
self.toolBar = [[UIToolbar alloc] initWithFrame:view.bounds]; | |
self.toolBar.tintColor = [UIColor redColor]; | |
[view.layer insertSublayer:self.toolBar.layer atIndex:0]; | |
[self.view addSubview:view]; | |
double delayInSeconds = 2.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
- (void)layoutSubviews { | |
[super layoutSubviews]; | |
[self applyEditingModeBackgroundViewPositionCorrections]; | |
} | |
/** | |
When using a backgroundView or selectedBackgroundView on a custom UITableViewCell | |
subclass, iOS7 currently |
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
// Workaround for missing test resources when run unit tests within android studio. | |
// This copy the test resources next to the test classes for each variant. | |
// Tracked at https://github.com/nenick/AndroidStudioAndRobolectric/issues/7 | |
// Original solution comes from https://code.google.com/p/android/issues/detail?id=136013#c10 | |
gradle.projectsEvaluated { | |
// Base path which is recognized by android studio. | |
def testClassesPath = "${buildDir}/intermediates/classes/test/" | |
// Copy must be done for each variant. | |
def variants = android.applicationVariants.collect() |