Archive for the ‘Uncategorized’ Category

Colour your git

Friday, February 7th, 2014

You want autocompletion, colours and your current branch in your terminal? You can find hundreds of tutorials on the net, I will just tell you what to do on MacOS:

Add these lines to your .bash_profile

This will enable autocompletion for git commands and branch names and also show your current branch. Note that in the last line, you can change colours if you’d like to be different.

You may need these two files in /usr/local/git/contrib/completion.

To enable fancy colours in your git command output, type:

or just some of these if you don’t want everything coloured:

Enjoy your all-new Terminal.

Breakpoint for Objective-C exceptions

Wednesday, December 11th, 2013

You can add a breakpoint for Objective-C exceptions in Xcode like this:

Switch to the breakpoint navigator (Cmd+7), press the “+” button in the lower left and “Add symbolic breakpoint…”. Then put symbol “objc_exception_throw” in module “libobj.A.dylib” like this:

Screen Shot 2013-12-11 at 13.55.47

By default, Xcode will only break on [NSException raise], which then in turn calls objc_exception_throw.

You can move this breakpoint to “global” by right clicking it and “Move breakpoint to –> User”.