Skip to content

Instantly share code, notes, and snippets.

@rustle
rustle / gist:4115414
Created November 20, 2012 01:45
Source Tree with Kaleidoscope 2 beta

SourceTree does not yet officially support Kaleidoscope 2, so here is how to set it up:

In Preferences, under Diff:

Screen Shot

You can try selecting Kaleidoscope, but we have had reports of mixed results. Some people have rebuilt their launch services database and restarted and been able to use Kaleidoscope this way:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain use

//
// NSNotificationCenter+RSLAdditions.h
//
// Created by Doug Russell
// Copyright (c) 2012 Doug Russell. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@rustle
rustle / WeakExternCrash.m
Created September 15, 2012 02:04
Weak linking with extern NSString *const issue
#import <Social/Social.h>
/* Compiled with iOS 6 SDK
* Social.framework weak linked (Optional)
* Run on iOS 5.1 (simulator and device)
*/
// http://simx.me/technonova/software_development/checking_for_weak_linked_frameworks.html
//http://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html#//apple_ref/doc/uid/20002378-106633-CJBGFCAC
struct block_literal {
void *isa;
int flags;
int reserved;
void (*invoke)(void *);
void *descriptor;
void *byref_obj;
};
void foo(void)
Before @autoreleasepool a fairly common pattern in a try catch would be the following
NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc] init];
@try {
}
@catch (NSException *anException) {
}
@finally {
alias build='xcodebuild -scheme "SUBSTITUTEYOUROWNSCHEME"'
alias buildfiltered='build | grep -w '\''warning\|error\|BUILD FAILED\|BUILD SUCCEEDED'\'' | grep -v '\''\-\-warning'\'''
alias clean='build clean'
@implementation AppDelegate
{
UITextView *_textView;
}
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];