Skip to content

Instantly share code, notes, and snippets.

@andrewsardone
andrewsardone / gist:3740504
Created September 17, 2012 23:58
CGRectDivide

CGRectDivide is handy for slicing up a rectangle.

Example of getting a slice and the remaining area of a rectange.

CGRect rect = CGRectMake(0, 0, 240, 150);
  
CGRect remainder, slice;
    
CGRectDivide(rect, &slice, &remainder, 120, CGRectMinYEdge);

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@andrewsardone
andrewsardone / ExampleTests.m
Created February 1, 2012 16:00
Fake a neighboring class method for the object in test. Stolen from https://gist.github.com/1038034 with a clearer (to me) interface and example.
#import <SenTestingKit/SenTestingKit.h>
#import "SenTestCase+MethodSwizzling.h"
#pragma mark Fakes for Tests
@interface FakeMyObject : NSObject
/**
* A fake, or "stub," implementation of MyObject's +doSomething method.
*/