Skip to content

Instantly share code, notes, and snippets.

View MSch's full-sized avatar

Martin Schürrer MSch

View GitHub Profile
class Exception
alias_method :_message, :message
def message
"#{_message}\t\n#{backtrace.join("\t\n")}"
end
end
#!/bin/bash
VERSIONS="0.1 0.10 0.2 0.3 0.4 0.5 0.5b1 0.5b2 0.6 0.7 0.7.1 0.8 0.9"
for V in $VERSIONS
do
echo Checking out $V
git checkout origin/tags/$V
git clean -fd
git checkout .
git clean -fd
alias rake='macrake'
export GEM_HOME=~/.gem/macruby/1.9.2
export GEM_PATH=~/.gem/macruby/1.9.2:/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2
framework 'Cocoa'
require 'pp'
view = NSView.alloc.init
view.frame.origin.x = 5
pp view.frame
framework 'Cocoa'
view = NSView.alloc.init
view.frame.origin.x = 5
p view.frame.origin.x
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
#!/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" "$@"
@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
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 / 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 */