Skip to content

Instantly share code, notes, and snippets.

View perfectionist's full-sized avatar

David Loeffler perfectionist

View GitHub Profile
@perfectionist
perfectionist / tableCellReuseExample.m
Created January 18, 2012 20:44
TableView Cell Reuse
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if (cell == nil) {
@perfectionist
perfectionist / lazyRecipe.m
Created January 16, 2012 17:05
Override getter
@synthesize recipes = _recipes;
- (NSArray *)recipes {
if(nil == _recipes) {
// create the recipes
}
return _recipes;
}
@perfectionist
perfectionist / Gemfile
Created September 13, 2011 22:17
Gemfile for Hartl's Rails Tutorial converted to Rails 3.1
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3', "~> 1.3.4"
gem 'gravatar_image_tag', '1.0.0'
gem 'will_paginate', '3.0.0'
@perfectionist
perfectionist / foo.rb
Created September 1, 2011 21:08
test
class Foo
def hello
puts "hello world"
end
end