Skip to content

Instantly share code, notes, and snippets.

View mitchellh's full-sized avatar
👻
Building.

Mitchell Hashimoto mitchellh

👻
Building.
View GitHub Profile
948a949
> struct INATEngine;
997a999
> typedef struct INATEngine INATEngine;
1019c1021,1022
< SettingsVersion_Future = 12
---
> SettingsVersion_v1_10 = 12,
> SettingsVersion_Future = 13
1039c1042
# This shows host only networking in a Multi-VM environment.
#
# The key point in this example is that the web and db sub-VMs
# are put on the same network so they can communicate with each
# other.
Vagrant::Config.run do |config|
# ...
config.vm.define :web do |web_config|
# Attach the web VM to the host only interface with a
# How to properly handle circular references with factory_girl and rails
class Computer < ActiveRecord::Base
has_many :softwares
end
class Software < ActiveRecord::Base
belongs_to :computer
end
# Validates that a given collection is properly populated.
#
# Usage:
#
# class Person
# has_many :assets
# validates :assets, :populated_collection => true
# end
#
class PopulatedCollectionValidator < ActiveModel::EachValidator
From f9dc8652969aa9372ded7651d844012b717f0bf0 Mon Sep 17 00:00:00 2001
From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date: Tue, 24 Aug 2010 08:42:42 -0700
Subject: [PATCH] Typo fix in Thor::Group documentation on `desc`
---
lib/thor/group.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/thor/group.rb b/lib/thor/group.rb
From adf9b164eddbfd631d33260671013047eec7a852 Mon Sep 17 00:00:00 2001
From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date: Thu, 2 Sep 2010 23:07:54 -0700
Subject: [PATCH] `rake install` properly reports error only when install fails
---
lib/bundler/gem_helper.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
From 3b9abad80034f7aeef96a4b3f247d95cb42a4dee Mon Sep 17 00:00:00 2001
From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date: Sun, 5 Sep 2010 23:39:10 -0700
Subject: [PATCH] Gemfile for easier development. Updated gemspec to be more modern.
---
.gitignore | 1 +
Gemfile | 3 +
Gemfile.lock | 21 ++++++++
Thorfile | 33 +-----------
From 167b396fea695832b07710ee318c9f903897d509 Mon Sep 17 00:00:00 2001
From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date: Sun, 5 Sep 2010 23:48:07 -0700
Subject: [PATCH] Documentation fix to clarify Thor::Actions#directory
---
lib/thor/actions/directory.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/thor/actions/directory.rb b/lib/thor/actions/directory.rb
thor[master] → thor -T
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/shell.rb:26: warning: already initialized constant SHELL_DELEGATED_METHODS
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/parser/argument.rb:3: warning: already initialized constant VALID_TYPES
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/parser/arguments.rb:3: warning: already initialized constant NUMERIC
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/parser/option.rb:5: warning: already initialized constant VALID_TYPES
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/parser/options.rb:6: warning: already initialized constant LONG_RE
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vendor/thor/parser/options.rb:7: warning: already initialized constant SHORT_RE
/Users/mitchellh/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.0/lib/bundler/vend
From 4378794887eabd083daaedeac25893fc178a4bc9 Mon Sep 17 00:00:00 2001
From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date: Mon, 13 Sep 2010 13:32:07 -0600
Subject: [PATCH 2/2] More modern gemspec which won't break when files are added/removed
---
sinatra.gemspec | 96 ++++++++++---------------------------------------------
1 files changed, 17 insertions(+), 79 deletions(-)
diff --git a/sinatra.gemspec b/sinatra.gemspec