Skip to content

Instantly share code, notes, and snippets.

View nzeltzer's full-sized avatar

Nicole Zeltzer nzeltzer

View GitHub Profile
//
// LBXLegalTextLayoutManager.m
// LawBox
//
// Created by Nicholas Zeltzer on 2/10/14.
//
//
#import "LBXLegalTextLayoutManager.h"
#import "LBXLegalTextContainer.h"

Introduction

This page operates as an introduction to who I am, what I value, and how to work with me effectively. I hope you find it interesting and useful. I’ve tried to be as explicit as possible in the hope that clear guidance is useful to you as you build your working relationship with me.

Yes, I’m Transgender

I think it’s helpful to lead with something obvious, at least if you’ve met me: I’m a trans-woman.

•	My name is Nicole. 
•	My pronouns are she/her.

An Introduction to Software Development (for Non-Engineers)

Imagine, for a moment, that everyone at your company is working together to produce a modest little motion picture. This movie will have only a handful of characters, one or two locations, and will be less than an hour long. It’s targeted squarely at a small subset of the movie going public, and is so carefully conceived that it will only require a small company of people to plan it.

Now, imagine that, for budgetary reasons, you will not be making this movie directly. Instead, you are going have it made for you by robots. Really stupid robots. Really stupid robots that live on the moon. You are going to make a movie by emailing movie instructions to a bunch of stupid robots on the moon. And – because the universe is an amateur comedian, and your life is its stool – your movie instructions will need to be written in a language that only a few people at your company understand. The entire company will get together to plan the story, design the s

@nzeltzer
nzeltzer / KCDTableViewSnap
Last active August 29, 2015 14:08
A utility function for determining the proper content offset for snapping a table view to row boundaries.
+ (CGPoint)tableView:(UITableView*)tableView snapContentOffset:(CGPoint)proposedTargetOffset;
{
/** Does not work for grouped table views, or table views with header or footer views. */
CGPoint targetPoint = CGPointZero;
NSIndexPath *anIndexPath = nil;
CGFloat leastDistance = CGFLOAT_MAX;
CGFloat heightOfLastRow = 0;
BOOL useTableViewDelegate = ([tableView.delegate respondsToSelector:@selector(tableView:heightForRowAtIndexPath:)]);
for (NSUInteger section = 0; section < [tableView numberOfSections]; section++)
{
@nzeltzer
nzeltzer / typeOfImageAtURL()
Last active August 29, 2015 14:05
Retrieve uniform type identifier from an image URL by examination of underlying data (as opposed to file extension).
NSString * typeOfImageData(NSData *imageData, NSString *typeHint) {
NSString *imageType = nil;
CGDataProviderRef provider = NULL;
if ((provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)imageData))) {
imageType = typeOfImage(provider, typeHint);
CGDataProviderRelease(provider);
}
return imageType;
}
@nzeltzer
nzeltzer / lbx_protocol_includesSelector
Last active August 29, 2015 13:56
Check to see if a formal protocol includes a specific Objective-C selector.
BOOL lbx_protocol_includesSelector(Protocol *aProtocol, SEL aSelector)
{
// Check that protocol includes method.
BOOL (^includesSelectorWithOptions)(Protocol*, SEL, BOOL, BOOL) =
^BOOL(Protocol *pro, SEL sel, BOOL req, BOOL inst)
{
unsigned int protocolMethodCount = 0;
BOOL isRequiredMethod = req;
BOOL isInstanceMethod = inst;