josh.github.io

li.active a:link Example output (specificity): | 0 | 2 | 2 | See also: https://www.codecaptain.io/tools/css-specificity-calculator

makandra dev
github.com

Axlsx is an incredible gem to generate "Office Open XML" spreadsheet files (XLSX). Does not break on large spreadsheets and...

rspec.info

You can define methods in any example group using Ruby's def keyword or define_method method: describe "example" do...

TLDR: In tests you need to clean out the database before each example. Use :transaction where possible. Use :deletion for...

When you are using git rebase and are currently editing a commit (due to a conflict, for example), you may...

durdn.com

This article contains: Making ‘git diff’ wrap long lines Set a global proxy Clone only a specific branch

makandra dev

The bash offers control over the behavior of autocompletion. The most primitive example is this (just run it in your...

The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...

Static error pages To add a few basic styles to the default error pages in Rails, just edit the default...

If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...

Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.

You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...

Capybara uses www.example.com as the default hostname when making requests. If your application does something specific on certain hostnames and...

progfu.com

I am talking about development speed. When your application starts growing and you start adding gems, it starts to take...

makandra dev
github.com

The gem author Jonas Nicklas highlights in a Google Groups post that the release is not backwards compatible to 1...

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...

coding.smashingmagazine.com

JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications...

Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...

developer.mozilla.org

Having your site run on SSL is worthless when you include content over an unsafe connection (HTTP).

ActiveModel::Errors is used to handle validation errors on Rails objects. If you inspect an instance, it feels like a...

If you require your Rails models manually, pay attention to the path you use. Unless you have...

makandra dev
github.com

Show failing specs instantly. Show passing spec as green dots as usual. Configuration: # spec/spec.opts (.rspec for rspec 2) --require rspec/instafail...

In a Rails application, *_spec.rb files get special treatment depending on the file's directory. E.g. when you put a...