Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcus Crafter crafterm

View GitHub Profile
@crafterm
crafterm / MPFlipViewController.podspec
Created Jul 8, 2013
Experimental podspec for local MPFlipViewController that includes various merged pull requests/updates
View MPFlipViewController.podspec
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'
View gist:5307989
//============ AppDelegate ===============
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
NSMutableArray *controllers = [NSMutableArray array];
View Bash
$ /Developer/usr/bin/momc simpleTextMessageModel.xcdatamodel simpleTextMessageModel3.mom
View LRPopoverManager.h
//
// LRPopoverManager.h
// Spark
//
// Created by Luke Redpath on 24/05/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
View atomic.rb
module ActiveRecord
class Base
def atomic &block
self.class.transaction {
lock!
yield
}
end
end
View 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
View carbon.md

Vim

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

Emacs

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

Textmate

View gist:184977
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:'
View file_matcher.rb
#
# 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
View MGScopeBar.h.patch
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.