Skip to content

Instantly share code, notes, and snippets.

View jon's full-sized avatar

Jon Olson jon

View GitHub Profile
//
// UIWebView+SmartJS.h
//
// Created by Jon Olson on 12/27/08.
// Copyright 2008-2009 Ballistic Pigeon, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const SmartJSErrorDomain;
@jon
jon / boss.c
Created November 10, 2009 22:53
void init_shm() {
shm_global_key = ftok(IPC_KEY_FILE, SHM_GLOBAL_KEY);
shm_thread_key = ftok(IPC_KEY_FILE, SHM_THREAD_KEY);
if ((shm_global_d = shmget(shm_global_key, sizeof(shm_global_t),
IPC_CREAT | 0660)) < 0) {
perror("shmget-global");
return 5;
}
# Builds an iPhoneOS/Simulator compatible version of BoehmGC and packages
# it up into a "static framework" as per Landon Fuller's suggestion at
# http://landonf.bikemonkey.org/code/iphone/iPhone_Framework_Support.20081202.html
fail() {
echo $1 >&2
exit 1
}
clean() {
@jon
jon / BPGeometry.h
Created February 2, 2010 03:22
A collection of 2D vector-geometry functions for dealing with CGPoints in Cocoa/Cocoa Touch
/*
* BPGeometry.h
*
* Created by Jon Olson on 11/30/09.
* Copyright 2009 Ballistic Pigeon, LLC. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
@jon
jon / BPUUID.h
Created February 3, 2010 21:09
An Objective-C wrapper for CFUUID
//
// BPUUID.h
// Skates
//
// Created by Jon Olson on 2/3/10.
// Copyright 2010 Ballistic Pigeon, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@jon
jon / BPImageTransformer.h
Created February 3, 2010 22:21
An NSValueTransformer to convert images to/from serialized PNGs (for CoreData)
//
// BPImageTransformer.h
// Skates
//
// Created by Jon Olson on 2/3/10.
// Copyright 2010 Ballistic Pigeon, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@jon
jon / BPButtonTableViewCell.h
Created February 9, 2010 18:50
A tappable button cell for UITableViews
//
// BPButtonTableViewCell.h
// Brewtool
//
// Created by Jon Olson on 9/24/09.
// Copyright 2009 Ballistic Pigeon, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@jon
jon / BPTextFieldViewController.h
Created February 9, 2010 22:15
A table view containing a single editable text field
//
// BPTextFieldViewController.h
//
// Created by Jon Olson on 10/2/09.
// Copyright 2009 Ballistic Pigeon, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
#!/usr/bin/ruby
require 'osx/cocoa'
include OSX
require_framework 'ScriptingBridge'
Xcode = SBApplication.applicationWithBundleIdentifier 'com.apple.Xcode'
Xcode.sourceDocuments.get.each { |d|
d.closeSaving_savingIn(('ask '.unpack('N').first), nil)
@jon
jon / gist:307651
Created February 18, 2010 13:32
Convenient script to tack on as a "Run Script" action at the end of iPhone build targets.
PACKAGING_DIR="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME-tmp"
rm -rf "$PACKAGING_DIR" || exit 1
mkdir -p "$PACKAGING_DIR/Payload" || exit 1
cp -R "$BUILT_PRODUCTS_DIR/$WRAPPER_NAME" "$PACKAGING_DIR/Payload" || exit 1
$( cd "$PACKAGING_DIR" && ditto -c -k --keepParent --rsrc ./Payload "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.ipa" ) || exit 1