Skip to content

Instantly share code, notes, and snippets.

View neror's full-sized avatar

Nathan Eror neror

View GitHub Profile
diff --git a/iphone/Nukefile b/iphone/Nukefile
index 30a6ebc..dda717d 100644
--- a/iphone/Nukefile
+++ b/iphone/Nukefile
@@ -1,23 +1,23 @@
-(set platform "iPhoneOS")
+(set platform "iPhoneSimulator")
;; source files
(set @c_files (filelistWithRoot "^objc/.*\.c$" ".."))
SQLITE_DB_FILE=AppData.sqlite
SIMULATOR_HOME=$(HOME)/Library/Application\ Support/iPhone\ Simulator
dbshell:
find $(SIMULATOR_HOME) -name "$(SQLITE_DB_FILE)" -exec sqlite3 {} ';'
killdb:
find $(SIMULATOR_HOME) -name "$(SQLITE_DB_FILE)" -exec rm {} ';'
dbschema:
#import <UIKit/UIKit.h>
#import "GTMStackTrace.h"
#ifdef DEBUG
extern BOOL NSDebugEnabled;
extern BOOL NSZombieEnabled;
extern BOOL NSDeallocateZombies;
extern BOOL NSHangOnUncaughtException;
static void exceptionHandler(NSException *exception) {
FTLOG(@"%@", GTMStackTraceFromException(exception));
- (UIImage *)createBlurredGrayscaleScreenshotWithRange:(int)blurRange {
NSDate *now = [NSDate date];
FTLOG(@"%f: %@", [now timeIntervalSinceNow], NSStringFromSelector(_cmd));
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
int bitsPerComponent = CGImageGetBitsPerComponent([viewImage CGImage]);
-(void)playMovieAtURL:(NSURL*)theURL {
MPMoviePlayerController* theMovie = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
theMovie.movieControlMode = MPMovieControlModeHidden;
// Register for the playback finished notification.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
BEGIN TRANSACTION;
CREATE TABLE vehicle_type (
id int primary key,
name text
);
INSERT INTO "vehicle_type" VALUES(1,'Car');
INSERT INTO "vehicle_type" VALUES(2,'Truck');
CREATE TABLE make (
id int primary key,
name text
#import <Foundation/Foundation.h>
void PrintPathInfo(); //section 1
void PrintProcessInfo(); //section 2
void PrintBookmarkInfo(); //section 3
void PrintIntrospectionInfo(); //section 4
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
(in /Volumes/Docs/Writing/PragProg/bdcora2/Book)
TEXINPUTS=.:local/tex:../PPStuff/util/tex/BOOK:../PPStuff/util/tex::../PPStuff/bibliography:../PPStuff/sales_blurb </dev/null latex book | ruby "/Volumes/Docs/Writing/PragProg/bdcora2/PPStuff/util/bin/tidyop.rb" --quiet
kpathsea: Running mktextfm pzdr
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input pzdr
This is METAFONT, Version 2.718281 (TeX Live 2010)
kpathsea: Running mktexmf pzdr
! I can't find file `pzdr'.
(in /Volumes/Docs/Writing/PragProg/bdcora2/Book)
TEXINPUTS=.:local/tex:../PPStuff/util/tex/BOOK:../PPStuff/util/tex::../PPStuff/bibliography:../PPStuff/sales_blurb </dev/null latex book | ruby "/Volumes/Docs/Writing/PragProg/bdcora2/PPStuff/util/bin/tidyop.rb" --quiet
This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
restricted \write18 enabled.
entering extended mode
(./book.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, arabic, armenian
, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutch, u
git ls-files -o|python -c "import sys;[sys.stdout.write(\"'\"+s.strip()+\"'\\n\") for s in sys.stdin.readlines()]"|xargs rm