You can now add code blocks without indentation, by using triple-backticks: ``` Code block goes here. ```

When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your...

Imagine you have a piece of code that tries to send a request to a remote server. Now the server...

You can use text-overflow to truncate a text using CSS but it does not fit fancy requirements.

Most of the JavaScript snippets have code that manipulates the DOM. For that reason dom manipulating javascript code should have...

makandra dev

This describes all the steps you'll need to get Solr up and running for your project using the Sunspot...

makandra dev
github.com

Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites.

Removing features and merging those changes back can be painful. Here is how it worked for me.\

When selecting records in a date range, take care not to do it like this: start_date = Date.parse('2007-05...

Code coverage is the ratio of code lines kissed by a test vs. the total number of lines in your...

The unix command line tool less is a good choice for browsing logfiles. In the standard configuration, though, it does...

When you use google analytics to track your visitors interactions, you should ensure that it runs on your production site...

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