Skip to content

Instantly share code, notes, and snippets.

@tapi
tapi / genModels.sh
Created July 31, 2013 22:05
An Xcode build phase script to automatically run mogenerator on your xcdatamodel if it has changed
# Xcode sets up its own PATH variable so we want to ensure that it includes /usr/local/bin
PATH=$PATH:/usr/local/bin
# Check that mogenerator is available
command -v mogenerator >/dev/null 2>&1 || { echo >&2 "You need mogenerator but it's not installed. To install using homebrew use 'brew install mogenerator'. Aborting."; exit 1; }
# Change the working dir to where our models are
cd "${SRCROOT}"/Models
# Only run mogenerator if the access time for ResultsCache.xcdatamodeld is newer than our lock file
@tapi
tapi / genModels.sh
Created July 31, 2013 22:04
An Xcode build phase script to automatically run mogenerator on your xcdatamodel if it has changed
# Xcode sets up its own PATH variable so we want to ensure that it includes /usr/local/bin
PATH=$PATH:/usr/local/bin
# Check that mogenerator is available
command -v mogenerator >/dev/null 2>&1 || { echo >&2 "You need mogenerator but it's not installed. To install using homebrew use 'brew install mogenerator'. Aborting."; exit 1; }
# Change the working dir to where our models are
cd "${SRCROOT}"/Models
# Only run mogenerator if the access time for ResultsCache.xcdatamodeld is newer than our lock file
@tapi
tapi / .gitignore
Last active December 15, 2015 20:49 — forked from adamgit/.gitignore
Adds the AppCode .idea folder
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@tapi
tapi / NSObject+SMDictionaryMapper.h
Created April 25, 2012 11:37
Dictionary <--> Object Mapper for Objective-C
//
// NSObject+SMDictionaryMapping.h
// SoundTrack
//
// Created by Paddy O'Brien on 12-04-24.
// Copyright (c) 2012 Paddy O'Brien. All rights reserved.
//
#import <Foundation/Foundation.h>
@tapi
tapi / KVO.js
Created February 24, 2012 01:36
Quick and dirty Javascript KVO
/* Extends the Class Object Written by Resig. http://ejohn.org/blog/simple-javascript-inheritance/ */
Class.prototype.addObserver = function(/** String */ key, /** Object */ observer, /** Function */ method)
{
if (key !== null && key !== undefined &&
observer !== null && observer !== undefined &&
method !== null && method !== undefined)
{
eval("this._" + key + " = this." + key);
this.__defineGetter__(key, function()