The classical scenario: There's a parent div element and you want to center some arbitrary child element vertically inside...
When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...
Modern cameras often produce JPEGs that have a "I should be rotated 90° to the left" flag. If you process...
Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")
JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications...
YourClass.reflect_on_all_associations.map(&:name) Get the class name by calling class_name, or the type of the association (belongs_to, has_many...
Ever wanted to preview a pattern from Subtle Patterns on your site without the hassle of swapping out images and...
gleeBox is an experimental project that takes a keyboard-centric approach to navigating the web. It provides alternatives to actions...
Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...
You can use scheme-less URLs (or protocol-relative URLs) to have browsers use the current protocol (HTTP or HTTPS...
Under certain (unknown) circumstances, Rails will give localized files an invalid content-type in the Response header. For me, after...
Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is...
If you're using the Capybara webdriver, steps sometimes fail because the browser hasn't finished loading the next page...
Huge set of 315 free vector icons. You can choose which one you'd like, add your own SVGs, then...
Our most recent pattern is EMAIL = /\A[a-z0-9\+\-_\.]+@[a-z\d\-.]+\.[a-z]+\z/i Notes
Browser rendering engines are very slow at rendering large box shadows. I had a situation where a complex layout with...
While git branch will show you all branches and highlight the current one with an asterisk, it can be too...
In theory you can take any scope and extend it with additional joins or conditions. We call this chaining scopes...
Around will not happen until after a feature's Background has been processed. Use Before and After to avoid that...
Hashrocket Lunch n' Learn #1 with Avdi Grimm: Making Little Classes out of Big Ones A look at the pros...
If you require your Rails models manually, pay attention to the path you use. Unless you have...
Why is this useful? You can have a background image on the same element, overlaying it with a transparent gradient...
When is this useful? When both parent and child elements have borders, with this technique you don't get two...
If your application has forms to edit string fields, you probably want to strip the entered values (remove whitespace from...