Skip to content

Instantly share code, notes, and snippets.

View subdigital's full-sized avatar

Ben Scheirman subdigital

View GitHub Profile
@subdigital
subdigital / gist:1109984
Created July 27, 2011 17:58
Error trying to archive with xcode4_archive_mode = true
** Invoke version (first_time)
** Execute version
Setting version to 0.3.0.854
** Invoke tag (first_time)
** Execute tag
Tagged v0.3.0.854
** Invoke release_notes (first_time)
** Execute release_notes
** Invoke beta:archive (first_time)
** Invoke beta:build
@subdigital
subdigital / better_card_spec.rb
Created May 15, 2011 02:22
Better rspec structure with subject & let blocks
#improved example
require 'spec_helper'
describe Card do
subject do
Card.new(card_type)
end
describe "#value" do
context "Two of Hearts" do
@subdigital
subdigital / ObsidianCode.dvtcolortheme
Created February 21, 2011 20:24
Obsidian Code Theme for Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
group :development, :test do
gem 'capybara'
gem 'rspec'
gem 'rspec-rails'
gem 'autotest'
gem 'autotest-rails'
gem 'cucumber'
gem 'cucumber-rails'
gem 'database_cleaner'
gem 'pickler'
@subdigital
subdigital / savon_vcr.rb
Created January 27, 2011 20:06
Trying to get savon working with vcr, however it doesn't record the cassette file
VCR.config do |c|
c.cassette_library_dir = 'fixtures/cassettes'
c.stub_with :webmock
end
class VCRSavonTest < Test::Unit::TestCase
def setup
path = File.expand_path("../fixtures/cassettes", __FILE__)
`rm -rf #{path}`
end
@subdigital
subdigital / Heroku + json_pure conflict
Created November 19, 2010 16:33
On a brand new Rails 3 app....
[~/cool-app (master)]$ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using ZenTest (4.4.0)
Using abstract (1.0.0)
Using activesupport (3.0.1)
Using builder (2.1.2)
Using i18n (0.4.2)
Using activemodel (3.0.1)
Using erubis (2.6.6)
@subdigital
subdigital / compress_requests.rb
Created October 20, 2010 00:05
Rack Middleware to automatically unzip gzipped/deflated POST data
class CompressedRequests
def initialize(app)
@app = app
end
def call(env)
if env['REQUEST_METHOD'] =~ /(POST|PUT)/
if env.keys.include? 'HTTP_CONTENT_ENCODING'
input = env['rack.input'].read
@subdigital
subdigital / Foo.hbm.xml
Created December 23, 2009 16:27
These are just so I can refer to them later.
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="YOUR_ASSEMBLY"
namespace="YOUR_NAMESPACE">
<class name="Foo" table="foos">
<id name="id">
<generator class="identity"/>
</id>
<property name="Bar" not-null="true"/>
</class>
public static string Pluralize(this string str)
{
if(str.EndsWith("s"))
return str + "es";
return str + "s";
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
cell.opaque = NO;
cell.textLabel.backgroundColor = [UIColor clearColor];