web.archive.org

...any cleanup yourself. Why? Understand this: before(:context) is run when the context/describe block begins, before(:context) is run outside of transactions, so data created here will bleed into other...

Git has the concept of hooks: bash scripts that are invoked at certain points in the Git lifecycle. One handy...

No out of the box I18n support for translating the database values But: Better support for the enumerated database type and therefore better suited for performance optimizations

Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...

caniuse.com

All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and...

You can run bundle install in parallel. This might be helpful for development, where you often install many new gems...

docs.gitlab.com

Use rules to include or exclude jobs in pipelines. Rules are evaluated in order until the first match. When a...

github.com

Ever needed to use a global variable in Rails? Ugh, that's the worst. If you need global state, you...

This card shows you how to center a float horizontally in CSS. Also: find out what techniques are available for...

For performance improvements (and to remove the need for eager loading), the ActsAsTaggableOn gem supports caching your tag lists directly...

We recently migrated a Rails application from yarn to npm. We decided to go this step instead of upgrading to...

...lot of logic and callbacks for a particular form screen, but then the model becomes a pain in tests, where all those callbacks just get in the way. Or we...

...have different forms for the same model but they need to behave very differently (e.g. admin user form vs. public sign up form). There are many approaches that promise help...

When accepting GIF images, you will also accept animated GIFs. Resizing them can be a time-consuming task and will...

makandra dev

...API (notable methods and properties) video = document.querySelector('video') video.play() video.pause() video.load() // Reset to the beginning and select the best available source video.currentSrc // The selected source video.currentTime // The current playback time...

To run additional code before an existing Rake tasks you can add a dependency like this: task :before_task...

These steps are now part of Spreewald. Here are some useful examples how to use the attached Cucumber Timecop steps...

...willy@astor.de" And I follow "Cancel account" Then I should see "Account canceled" By going beyond the single line descriptions we've accustomed to, we can provide all the information that...

...file_inside' do let(:path) { '/opt/invoices/' } it 'should send a requested file that lives beneath the given directory' do subject.should_receive(:send_file).with('/opt/invoices/123.pdf', {}) subject.send :send_file_inside, path...

To set a cookie in your test browser for cucumber tests, you need to know which driver you are using...

Disclaimer This card is a collection of guides and things to have in mind when upgrading to a specific version...

github.com

Put the attached file into features/support/. Example usage: When /^I open the task named "(.+?)"$/ do |task_name| task = page.all('.task...

If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...

When you use a belongs_to or has_many macro you might be surprised that the methods that it generates does not override a method with the same name. Take...

class Project < ActiveRecord::Base def user "foo" end belongs_to :user end Project.new.user still returns "foo". The reason for this is that what belongs_to does is actually...

Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting.