When using Savon to connect a SOAP API, you may want to use Savon::SpecHelper to mock requests in your...

bevacqua.github.io

Datetime picker that offers: simple UI without a specific framework several of customization options allows custom date/time validations Localization happens...

jasmine.github.io

Jasmine has a jasmine.clock() helper that you can use to travel through time and trigger setTimeout and setInterval callbacks:

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...

When you want to UPDATE a table with information from an associated table, you can JOIN the associated table into...

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...

bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...

iana.org

When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...

# Given the following models class Image < ActiveRecord::Base has_many :album_images has_many :albums, through: :album_images

When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.

You know that ActiveRecord caches associations so they are not loaded twice for the same object. You also know that...

Instead of this: Image.order('images.created_at DESC') You can write this: Image.order(created_at: :desc) Not only do you not...

It's generally not trivial to change a datetime's seconds, minutes, etc in SQL. Here is how it works...

Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...

github.com

You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for...

railscasts.com

See this Railscast. Basically you can simply write views like index.xlsx.erb: ID Name Release Date Price <% @products.each do |product| %> <%= product.id...

Write a // and indent every subsequent line by two spaces. This is great for documenting BEM blocks! // An action button...

SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database' order by table_rows;

robots.thoughtbot.com

Good article about window functions. Also note how they use a postgres feature called common table expressions.

This guide shows how to create an AngularJS application that consumes more and more memory until, eventually, the browser process...

xaprb.com

The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...

nandovieira.com

Postgres 9.4 introduces a new column type: jsonb. json and jsonb columns store data differently, so just compare the two...

When you are using the #selector_for helper in Cucumber steps, as e.g. Spreewald does, the following snippet will save...

guides.rubyonrails.org

When running migrations with rake db:migrate, there's the STEP and VERSION parameters that you can pass to nearly...