Skip to content

Instantly share code, notes, and snippets.

@mikeash
mikeash / test.m
Created July 9, 2012 21:15
Cocoa array slicing
// clang -framework Foundation -fobjc-arc -O3 test.m
#import <Foundation/Foundation.h>
@interface Slice : NSObject
@property NSInteger start;
@property NSInteger length;
@end
@implementation Slice
@mbauman
mbauman / mac-bash-completion.patch
Created February 23, 2011 02:50
A patch to bash-completion version 1.3 (http://bash-completion.alioth.debian.org/). Adds completions for Mac OS X specific utilities: defaults, launchctl, open, and xcodebuild. Additionally, it properly enables killall.
diff -Naur bash-completion-1.3/completions/Makefile.am bash-completion-1.3-mac/completions/Makefile.am
--- bash-completion-1.3/completions/Makefile.am 2011-01-21 04:36:11.000000000 -0500
+++ bash-completion-1.3-mac/completions/Makefile.am 2011-02-22 22:02:25.000000000 -0500
@@ -33,6 +33,7 @@
cvs \
cvsps \
dd \
+ defaults \
dhclient \
dict \