gem install vagrant
vagrant up
vagrant halt
- Ruby DSL for provisioning VirtualBox VMs
- creates a user named vagrant, with password 'vagrant'
#This goes in application.rb | |
require 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(Rails.root.to_s, '') | |
@engine_paths ||= Rails::Application::Railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |path| |
##Scope and intro
I will be focusing on Rails 3 since this will be most applicable for greenfield development, and because there are Rails 2 bugs. To get started add the following to the Gemfile:
group :test do
gem 'cucumber'
gem 'cucumber-rails'
gem 'capybara'
gem 'database_cleaner'
##Intro
Janus is a "basic distribution of vim plugins and tools intended to be run on top of the latest MacVIM snapshot." It is maintained by Yehuda Katz and Carl Lerche.
I recently whinged on Twitter that all I really want is vim with TextMate's Command-T go-to-file functionality and some efficient visual tab/buffer navigation. Turns out MacVim + Janus, with just a few tweaks, is all that and more.
Follow the installation instructions on the git page
#two questions -- why does .count not return the narrowed down result set size, and why does .where seem to alter variable a? | |
a = Star.where(:brightness => 0) | |
=> #<Mongoid::Criteria:0xb6af2948 @documents=[], @options={}, @selector={:brightness=>0}, @klass=Star> | |
a.size | |
=> 1430 | |
a.count | |
=> 1430 |
#testing the speed of creating a new object via the association with mongoid | |
c = Club.first | |
####### 43 seconds ####### | |
begin | |
500.times do |i| | |
c.people.create(:name => 'Jim') | |
end | |
end |
-unless current_user.workouts.member?(workout) | |
=link_to image_tag('checkin.png'), checkin_url(:workout_id => workout.id, :user_id => current_user.id) | |
-else | |
=image_tag('done.png') |