Skip to content

Instantly share code, notes, and snippets.

View crafterm's full-sized avatar

Marcus Crafter crafterm

View GitHub Profile
@crafterm
crafterm / MPFlipViewController.podspec
Created July 8, 2013 01:27
Experimental podspec for local MPFlipViewController that includes various merged pull requests/updates
Pod::Spec.new do |s|
s.name = "MPFlipViewController"
s.version = "0.0.2"
s.summary = "Container view controller (iOS 5 containment API) that navigates between child view controllers via touch gestures and page-flip animations."
s.description = "A custom container view controller following the iOS 5 containment API that navigates between child view controllers via touch gestures and page-flip animations."
s.homepage = "http://markpospesel.com/2012/07/28/mpflipviewcontroller/"
s.license = { :type => 'Modified BSD License', :file => 'Source Code License.rtf' }
s.author = "Mark Pospesel"
s.source = { :git => "https://github.com/crafterm/MPFlipViewController.git", :commit => "d689b5a5e7" }
s.platform = :ios, '5.0'
//============ AppDelegate ===============
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
NSMutableArray *controllers = [NSMutableArray array];
@crafterm
crafterm / Bash
Created June 23, 2010 04:56 — forked from futureshocked/Bash
$ /Developer/usr/bin/momc simpleTextMessageModel.xcdatamodel simpleTextMessageModel3.mom
//
// LRPopoverManager.h
// Spark
//
// Created by Luke Redpath on 24/05/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
module ActiveRecord
class Base
def atomic &block
self.class.transaction {
lock!
yield
}
end
end
@crafterm
crafterm / url_dsl.rb
Created December 27, 2009 22:46 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
@crafterm
crafterm / carbon.md
Created November 5, 2009 22:58 — forked from defunkt/carbon.md

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

Silver-Raptor:~ crafterm$ macirb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'metaid'
NameError: undefined local variable or method `skip_list' for main:TopLevel
from 0:in `gem:'
from 0:in `eval:'
from 0:in `evaluate:'
from 0:in `evaluate:'
from 0:in `signal_status:'
#
# A Custom Matcher for RSpec that shows the difference between two multi-line strings.
# Author: Clifford Heath.
# Usage:
# actual_text.should_not differ_from(expected_text)
#
require 'diff/lcs'
module FileMatcher
Index: MGScopeBar.h
===================================================================
--- MGScopeBar.h (revision 42)
+++ MGScopeBar.h (working copy)
@@ -18,7 +18,7 @@
NSMutableDictionary *_identifiers; // map of identifiers to items.
NSMutableArray *_selectedItems; // all selected items in all groups; see note below.
float _lastWidth; // previous width of view from when we last resized.
- int _firstCollapsedGroup; // index of first group collapsed into a popup.
+ NSInteger _firstCollapsedGroup; // index of first group collapsed into a popup.