This file contains 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
@interface NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |
This file contains 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
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
This file contains 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
username: vagrant | |
password: vagrant | |
sudo apt-get update | |
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
sudo aptitude install mysql-server mysql-client | |
sudo nano /etc/mysql/my.cnf |
This file contains 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
# config/environments/production.rb | |
# We're on Heroku, just output straight to STDOUT | |
# This is required because we're using Unicorn: https://github.com/ryanb/cancan/issues/511#issuecomment-3643266 | |
config.logger = Logger.new(STDOUT) | |
config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO') |
This file contains 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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
This file contains 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
/** | |
* This sample lets you record and share video with Appcelerator Titanium on Android. | |
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
*/ | |
/** | |
* First, create our UI. We'll have two buttons: record, and share. | |
*/ | |
var win = Titanium.UI.createWindow({ |
This file contains 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
/** | |
* Appcelerator Titanium Mobile | |
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
*/ | |
#ifdef USE_TI_UISMSDIALOG | |
#import "TiProxy.h" | |
#import <MessageUI/MessageUI.h> |
This file contains 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
//Customise Backbone.sync to work with Titanium rather than jQuery | |
var getUrl = function(object) { | |
if (!(object && object.url)) return null; | |
return _.isFunction(object.url) ? object.url() : object.url; | |
}; | |
Backbone.sync = (function() { | |
var methodMap = { | |
'create': 'POST', | |
'read' : 'GET', |
This file contains 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
DEV_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' | |
DEV_SIGN = 'Your Signing Name' | |
ADHOC_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' | |
ADHOC_SIGN = 'Your Signing Name' | |
DEV_APP_DEVICE = 'ipad' # or iphone, universal | |
IPHONE_SDK_VERSION = '5.0' |
This file contains 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
/* | |
Model methods below requires Joli.js: https://github.com/xavierlacot/joli.js | |
Requires a tables named 'migrations' with columns id & version | |
Database migrations | |
Each migration is attached to a timestamp | |
When the migration is run, a record is added to the migrations table so it isn't run again | |
The rollback function takes a string date and rolls back all migrations since that date and deletes the migration record | |
Usage: |
NewerOlder