This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Get a sample dictionary here: | |
# http://labs.kitiyo.com/files/t9.dic | |
umask 077 | |
NUMN=/tmp/numn.$$ | |
trap "exit 1" HUP INT PIPE QUIT TERM | |
trap "rm -f $DICTN $NUMN" EXIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
/* | |
$ gcc -x objective-c -Wno-import -lobjc -framework Foundation subclassing.m | |
$ ./a.out | |
-[FooThatCallsSelf initWithBar:] | |
-[SubFooThatCallsSelf init] | |
-[FooThatCallsSuper initWithBar:] | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function serve() { | |
ruby -rwebrick <<-EOM | |
server = WEBrick::HTTPServer.new({ | |
:Port => 1234, | |
:DocumentRoot => File.expand_path('$1'), | |
:MimeTypes => WEBrick::HTTPUtils::load_mime_types('/etc/apache2/mime.types') | |
}) | |
trap("INT"){ server.shutdown } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate | |
codesign -f -s "iPhone Developer" "$1.app" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* NSObjectPropertyObservers.h | |
* | |
* Created by Nathan de Vries on 12/03/10. | |
* Copyright 2010 Nathan de Vries. All rights reserved. | |
* | |
*/ | |
#define OBSERVE_CHANGES_FOR_PROPERTIES(...) \ | |
\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSString * const AQPerThreadManagedObjectContext = @"AQPerThreadManagedObjectContext"; | |
void StoreManagedObjectContextForCurrentThread( NSManagedObjectContext * context ) | |
{ | |
[[[NSThread currentThread] threadDictionary] setObject: context forKey: AQPerThreadManagedObjectContext]; | |
} | |
NSManagedObjectContext * PerThreadManagedObjectContext( void ) | |
{ | |
NSManagedObjectContext * result = [[[NSThread currentThread] threadDictionary] objectForKey: AQPerThreadManagedObjectContext]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do shell script "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --enable-webgl & killall applet" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
brewprefix="$( brew --prefix )" | |
rvmpath="$HOME/.rvm" | |
sources=( | |
"$brewprefix/etc/bash_completion" | |
"$brewprefix/Library/Contributions/brew_bash_completion.sh" | |
"$rvmpath/scripts/rvm" | |
"$rvmpath/scripts/completion" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define ALog(format, ...) NSLog((@"%s [L%d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
# ifdef DEBUG | |
# define DLog(format, ...) ALog(format, ##__VA_ARGS__); | |
# else | |
# define DLog(...) | |
# endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check altitude... | |
http://ws.geonames.org/gtopo30JSON?lat=-33.92541457768646&lng=151.11934661865234&callback=loadJSON |