Skip to content

Instantly share code, notes, and snippets.

View kommen's full-sized avatar

Dieter Komendera kommen

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kommen on github.
  • I am kommen (https://keybase.io/kommen) on keybase.
  • I have a public key whose fingerprint is 139A F26F 5378 3EC5 1750 3093 08C6 65E7 CF8B 1940

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am kommen on github.
  • I am kommen (https://keybase.io/kommen) on keybase.
  • I have a public key whose fingerprint is 2870 6088 7CB6 77E4 A7CD 145A 5DE6 A38A C816 E624

To claim this, I am signing this object:

<% test_wrapping_helper do %>
some html
<% end %>
Process: Safari [43369]
Path: /Applications/WebKit.app/Contents/MacOS/WebKit
Identifier: org.webkit.nightly.WebKit
Version: r38297 (38297)
Code Type: X86 (Native)
Parent Process: launchd [111]
Date/Time: 2008-11-13 17:22:41.187 +0100
OS Version: Mac OS X 10.5.5 (9F33)
Report Version: 6
module Mocha
module ObjectMethods
def stub_path(path)
path = path.split('.') if path.is_a? String
raise "Invalid Argument" if path.empty?
part = path.shift
mock = Mocha::Mockery.instance.named_mock(part)
exp = self.stubs(part)
if path.length > 0
exp.returns(mock)
(?x)
\b
( # Capture 1: entire matched URL
(?:
[\w-]+: # URL protocol and colon
(?:
/{1,3} # 1-3 slashes
| # or
[[:alpha:][:digit:]] # Single letter or digit
# (Try not to match, say "URI::Escape")
What?
Command line tool to create hard links to directories with Mac OS X (10.5 or later). This is used by Time Machine.
Credits:
http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html
http://osxbook.com/blog/2008/11/09/hfsdebug-40-and-new-hfs-features/
Restrictions:
The hard link must be created in a directory different from the source directory's parent. See example below.
@kommen
kommen / pre-archive-action.sh
Created October 24, 2011 08:10
Pre-Archive action for Xcode 4.2 to auto increment CFBundleVersion
buildPlist="${SRCROOT}/${INFOPLIST_FILE}"
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $buildPlist)
CFBundleVersion=$(($CFBundleVersion + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" $buildPlist
@kommen
kommen / text
Created November 11, 2011 15:17
EXC_BAD_ACCESS is _class_getName when throwing NSException with ARC enabled
Throwing an exception like this:
@throw [NSException exceptionWithName:@"Exception" reason:@"none" userInfo:nil];
in a method, and trying to catch it in a method up the stack, causes a EXC_BAD_ACCESS in:
#0 0x36221fd0 in _class_getName ()
#1 0x36221fbc in object_getClassName ()
#2 0x362261fe in objc_exception_throw ()
@kommen
kommen / array_test.rb
Created December 1, 2011 11:15
Ruby Array inheritance change
class MyArray < ::Array
end
a = MyArray.new
puts a.class
puts a.reverse.class