Don't open user-supplied links with target="_blank"
This will give the target site full access to your Javascript environment through window.opener, if the target is on the...
How to fix routing error when using concerns in Rails up to 3.2.22.1
Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...
nginx: How to drop connections for a location
If you want to configure your nginx to drop connections to a specific location, you can do so by responding...
Rails route namespacing (in different flavors)
TL;DR There are three dimensions you can control when scoping routes: scope module: 'module', path: 'path', as: 'as' do...
Testing ActiveRecord callbacks with RSpec
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...
One-liner syntax in RSpec's should-based and expect-based syntaxes
RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created...
Testing ActiveRecord validations with RSpec
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
RSpec 3 argument constraints use weak equality
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...
IIFEs in Coffeescript
In JavaScript we often use Immediately Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside...
RSpec: be_true does not actually check if a value is true
Don't use be_true to check if a value is true. It actually checks if it anything other than...
Geordi 1.3 released
Geordi is now (partially) tested with Cucumber. Yay! geordi cucumber supports a new @solo tag. Scenarios tagged with @solo...
ActiveRecord meets database views with scenic
Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema...
Showing a custom maintenance page while deploying
Note The maintenance mode is enabled on all application server as soon as the file /public/system/maintenance.html is present. Installation
bash: print columns / a table
Ever wondered how you can create a simple table output in bash? You can use the tool column for creating...
yujinakayama/transpec: The RSpec syntax converter
A comprehensive script to convert test suites from RSpec 2 to RSpec 3. This converts more than should/expect syntax.
Geordi 1.2 released
Remove some old binaries (commands still exist in geordi) and mark others as deprecated Rewrite deploy command to support...
Make nokogiri >=1.6.0 use system libxml2
Quick check: bin/rails runner 'puts Nokogiri::VersionInfo.new.libxml2_using_system?' Step by step instruction Nokogiri uses vendored libxml2 since version...
nginx proxy_hide_header when used in multiple contextes
You can use proxy_hide_header in different contextes: Syntax: proxy_hide_header field; Default: — Context: http, server, location
Using regular expressions in JavaScript
Regular expressions in Javascript are represented by a RegExp object. There also is a regex literal as in many other...
RSpec & Devise: How to sign in users in request specs
You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work.
Defining and calling lambdas or procs (Ruby)
There are different ways to define a lambda or proc in ruby. [*] with lambda keyword test = lambda do |arg|
Stop writing "require 'spec_helper'" in every spec
Simply add this to your .rspec instead: --require spec_helper If you are on rspec >= 3 and use a rails_helper.rb...
Case Study: Analyzing Web Font Performance
Table of contents of the linked article: What are Web Fonts? Advantages of Web Fonts Disadvantages of Web Fonts
Test your application's e-mail spam scoring with mail-tester.com
You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be...