You know that you can collect an array as groups using in_groups or in_groups_of. Maybe you want...
I've recently encountered a weird problem with specs making lots of SOLR queries using the acts_as_solr plugin...
Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...
You don't need a Rails application to use Sass. Even when you're working on a static site you...
Given those modules: module A def foo; end def bar; end end module B end When you want to call...
Webmocks hash_including is similar to RSpec::Mocks::ArgumentMatchers#hash_including. Be aware that hash_including (webmock v3.0.1) doesn't...
Example task: Multiply the table holidays between several stages. Open two terminals: shell-for stage_1 shell-for stage_2...
...to re-send the request you could use the following snippet: def remote_request begin response = RestClient.get my_request_url rescue RestClient::ResourceNotFound => error @retries ||= 0 if @retries < @max_retries...
...retries (termination condition) was reached. With the retry statement you can re-execute the begin block that has been rescued from. Be aware that you could run into an infinite...
Cucumber has an output format that prints step definitions only. You can use this to find unused ones: Temporarily add...
Capybara does not play nice with sites that have some actions protected by SSL, some not. A popular way to...
For all late night coders: The program "redshift" changes your monitors' white balance according to your position on the planet...
Update: Staticmatic will not be further developed. They suggest to switch to middleman. If you need to make a static...
When you load a dump for development, records may reference images that are not available on your machine.
When you have a hook in your Capistrano file that dumps your remote database, you might not want it to...
Ctrl + R Search commands you entered previously. Press Ctrl + R again to search further back, Ctrl + Shift + R searches forward...
Ruby 1.9 changed the default behavior of Module.const_defined? from what it was in Ruby 1.8 -- this can be especially painful when external code (read: gems) uses const_defined? to...
1.9.3 > Bar.const_defined? :FOO => true 1.9.3 > Bar::FOO => 42 To get the old behavior back, you need to pass false as a second option: 1.9.3 > Bar.const_defined? :FOO, false...
Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...
Capistrano recently had some API changes that can results in deploys not working when running with old deploy.rb files.
Note: In Rails 3+ you can use Array.wrap instead of the solution here. In the past you could use Array...
When you print (or print preview) and elements are cut off (e.g. after 1st page, or "randomly") you should check...
So you have multiple screens under Xfce and want to have one task bar on each screen, only showing applications...
The most obvious way to use spring is to call it explicitly: spring rails console spring rake db:migrate...
Styling button tags across all major browsers is not easy. Many times you should be fine by using the native...
wrap the text with a span use line-height for the spacing between lines ("margin")