Skip to content

Instantly share code, notes, and snippets.

View MSch's full-sized avatar

Martin Schürrer MSch

View GitHub Profile
@MSch
MSch / build-phase.sh
Created October 20, 2011 17:47 — forked from aquarius/gist:1295218
Runs script build phase "Add git ref/tag to Info.plist"
defaults write "${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/Info GitVersion `git describe --always --tags --dirty`
// Part of FoundationKit http://foundationk.it
// based off http://www.dribin.org/dave/blog/archives/2008/09/22/convert_to_nsstring/ licensed under WHATVER
#import WHATEVER
OLog(@"asd ", self, aNotification, @"asd qwe", aNotification, self);
2011-07-04 01:14:49.844 Fragments[74240:707] [AppDelegate.m:21] @"asd ",
self = <AppDelegate: 0x100139910>,
aNotification = NSConcreteNotification 0x1001629d0 {name = NSApplicationDidFinishLaunchingNotification; object = <NSApplication: 0x100120e30>; userInfo = {
NSApplicationLaunchIsDefaultLaunchKey = 0;
}},
asd qwe,
aNotification = NSConcreteNotification 0x1001629d0 {name = NSApplicationDidFinishLaunchingNotification; object = <NSApplication: 0x100120e30>; userInfo = {
NSApplicationLaunchIsDefaultLaunchKey = 0;
@MSch
MSch / LogHelper.h
Created July 3, 2011 23:17
The ultimate awesome logging method
#import <Cocoa/Cocoa.h>
#include <stdarg.h>
// by @MSch <[email protected]>
// From http://stackoverflow.com/questions/2632300/looping-through-macro-varargs-values
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
/* C99-style: anonymous argument referenced by __VA_ARGS__, empty arg not OK */
2011-07-03 23:57:52.802 TreeTest[69405:707] An uncaught exception was raised
2011-07-03 23:57:52.802 TreeTest[69405:707] keypath _Z_FOK_PARENT not found in entity <NSSQLEntity Item id=1>
2011-07-03 23:57:52.806 TreeTest[69405:707] (
0 CoreFoundation 0x00007fff8b443986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8b9ebd5e objc_exception_throw + 43
2 CoreData 0x00007fff8a672a92 -[NSSQLGenerator newSQLStatementForFetchRequest:ignoreInheritance:countOnly:nestingLevel:] + 578
3 CoreData 0x00007fff8a672748 -[NSSQLAdapter _newSelectStatementWithFetchRequest:ignoreInheritance:] + 488
4 CoreData 0x00007fff8a6c26dc -[NSSQLCore newFetchedPKsForSourceID:andRelationship:] + 1324
5 CoreData 0x00007fff8a6c1c70 -[NSSQLCore newValueForRelationship:forObjectWithID:withContext:error:] + 672
6 CoreData 0x00007fff8a6c19c5 -[N
@MSch
MSch / .vimrc
Created July 3, 2011 16:58
JavaScript highlighting inside underscore.js templates for vim
" Add this to the bottom of your ~/.vimrc to enable jst highlighting
au BufNewFile,BufRead *.jst set syntax=jst
#!/usr/bin/env bash
export GEM_HOME="${GEM_HOME:-/Users/msch/.rvm/gems/macruby-0.10}"
export GEM_PATH="${GEM_PATH:-/Users/msch/.rvm/gems/macruby-0.10:/Users/msch/.rvm/gems/macruby-0.10@global}"
export MY_RUBY_HOME="/Users/msch/.rvm/rubies/macruby-0.10"
export PATH="/Users/msch/.rvm/gems/macruby-0.10/bin:/Users/msch/.rvm/gems/macruby-0.10@global/bin:/Users/msch/.rvm/rubies/macruby-0.10/bin:$PATH"
exec "/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/bin/macruby" "$@"
framework 'Cocoa'
view = NSView.alloc.init
view.frame.origin.x = 5
p view.frame.origin.x
view.frame = [5,0,0,0]
p view.frame.origin.x
framework 'Cocoa'
view = NSView.alloc.init
view.frame.origin.x = 5
p view.frame.origin.x
framework 'Cocoa'
require 'pp'
view = NSView.alloc.init
view.frame.origin.x = 5
pp view.frame