The SQL code generated by Graticule's spherical distance computation is insufficient and can lead to NULL distances in edge...

When you have objects in your database that hold latitude and longitude and you want to find others that are...

stackoverflow.com

The solution in this card is based on a stack overflow post by Leventix. If you need to make request...

rubyinside.com

While 2.0 will include a number of syntax changes, new features and general improvements, mentioned below, it is anticipated to...

First keep in mind that :dependent => :destroy hooks into before_destroy. So when you use other before_destroy callbacks the...

Defining a custom to_json method for your classes can be useful. Do it properly or you will "randomly" get...

makandra dev
stackoverflow.com

Using git rebase can be painful but luckily you can resort to cheating with git reset and committing anew.

web.archive.org

Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...

commandlinefu.com

The colors in Rails log files are helpful when watching them but, since they are ANSI color codes like ^[[4...

You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and...

stackoverflow.com

Most likely you run rake and your code is causing an exception which is not the one shown in your...

github.com

ExecJS lets you run JavaScript code from Ruby. It automatically picks the best runtime available to evaluate your JavaScript program...

If your application raises an error like ... Couldn't connect to the Solr server at http://127.0.0.1:8983/solr. 500 "Lock...

Remember how Rails 2 came with an awesome feature that broke all code using Time.now or Time.parse? This behavior is...

When writing a piece of reusable code, you sometimes need to have separate code for Rails 2 and Rails 3...

While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...

Calling Time#utc, Time#gmt or Time#localtime will not create a converted copy. Instead these methods modify the receiving...

papercut.com

Retaliation is a Jenkins CI build monitor that automatically coordinates a foam missile counter-attack against the developer who breaks...

I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks

makandra dev

If you want to use the (badly implemented!) solarized color scheme in your Rubymine IDE: Clone the IntelliJ IDEA port...

Open up your "Base File.sublime-settings" (Preferences Menu → File Settings – User) in Sublime Text 2. Add entries for font_face...

Date::Performance is a gem that replaces various method in Ruby's Date class with fast C implementations. Unfortunately it...

Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...

Whenever you deploy using Capistrano, a new folder is created within the releases directory on the remote server containing the...