Skip to content

Instantly share code, notes, and snippets.

View jmbeck's full-sized avatar

John Beck jmbeck

  • San Francisco, CA
View GitHub Profile
@jmbeck
jmbeck / gist:a837bfa89deea6aa3b58
Created May 21, 2014 17:27
GCD Background Thread Helpers
void perform_block_after_delay(CGFloat seconds, dispatch_block_t block) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
block();
});
}
void perform_block_on_main(dispatch_block_t block) {
dispatch_async(dispatch_get_main_queue(), ^{
block();
});
@jmbeck
jmbeck / gist:babb1b6446fe0e0872ab
Created May 21, 2014 15:25
Kochava Slow Startup on Main Thread
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CLS_LOG(@"launchOptions: %@", launchOptions);
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"kothredupios3903535ae2e402049", @"kochavaAppId",
// @"1", @"enableLogging",
@"1", @"retrieveAttribution",
nil];
NSLog(@"*** Begin init ***");
@jmbeck
jmbeck / .vimrc
Created December 20, 2013 17:10
Running tests from inside vim
let mapleader = " "
" rspec mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
function! RunCurrentSpecFile()
if InSpecFile()
let l:command = "zeus test " . @%