RSpec::Matchers.define :be_naturally_sorted do match do |array| array == array.natural_sort end end See RSpec: Where to put custom...
This step will pass if the specified select is sorted. Then /^the "(.*?)" select should be sorted$/ do |label, negate|
Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to...
If you want a class-like construct in JavaScript, you can use the module pattern below. The module pattern gives...
Sometimes you want Angular to watch an object only until a certain state is reached (e.g. an object appears in...
Copy data from LibreOffice Calc When you copy data from multi-line cells in LibreOffice Calc, quotation marks are automatically...
The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
When you run code inside a $watch expression that forces a repaint (e.g. by computing an element's width, or...
Option 0: Download from the official page (preferred) Open https://googlechromelabs.github.io/chrome-for-testing/ In Section "Stable" > chromedriver / linux64 > Download ZIP from...
A very clever hack to parse a structured URL object is to create a element and set its href to...
If you get one of this errors: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: ( ): found...
When putting phone numbers into web pages, you should use tel: links so smartphone users can click those numbers to...
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want...
Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes...
Cucumber allows for prose in features and scenarios. Example: Feature: Cancel account There are several ways to cancel a user...
If you make a gem with Bundler, you will get a rake release task that will instantly publish your gem...
This is a problem when using Selenium with Firefox. We recommend using ChromeDriver for your Selenium tests. Firefox will not...
Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.
Firefox 5.0.1, which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here...
Just install the texlive-xetex package: sudo apt-get install texlive-xetex Running integration tests without texlive-xetex will produce...
JavaScript's NaN ("Not a Number") is hard to compare against. It never equals anything, not even itself:
Since we are using LoDash instead of UnderscoreJS in recent/current projects, you should keep in mind that their syntax is...
bower-rails is a great solution for managing vendored assets in your Rails app. It feels especially much more convenient...
JavaScript structures that include circular references can't be serialized with a"plain" JSON.stringify. Example: a = { name: 'Groucho' };