Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...

robots.thoughtbot.com

We are changing our name from Hoptoad to Airbrake. You see, some folks much larger than us reached out and...

Regular expressions can have something called "zero-width look-behind assertions". This means that you want a pattern to be...

Install Ruby from the Ubuntu repository: sudo apt-get install ruby ruby-dev \ ruby is the meta package. If you...

sudo apt-get install sqlite3 libsqlite3-dev sudo gem install sqlite3-ruby

Ever wondered if there is a reverse for Rails' .each(&:to_s) idiom? Turns out there is... You probably already...

apidock.com

This is somewhat similar to the touch command of Linux: FileUtils.touch 'example.txt', :mtime => Time.now - 2.hours If you omit the :mtime...

qatechnotes.blogspot.com

If you encounter above mentioned failiure message after installing the ruby-debug gem then you have to explicitly require linecache...

shopify.com

Most web applications contain several examples of state machines, including accounts and subscriptions, invoices, orders, blog posts, and many more...

yehudakatz.com

Yesterday, there was a blog post entitled “What the Hell is Happening to Rails” that stayed at the number one...

crazylittlehacks.blogspot.com

I found a nice script on crazylittlehacks and modified it slightly. Put the attachment to /usr/local/bin, chmod +x and run...

Copy the attached Ruby code to config/initializers, or paste it into your IRB console. You can now dump any two...

yehudakatz.com

When running an executable, ALWAYS use bundle exec. In some cases, running executables without bundle exec may work, if the...

blog.jayfields.com

Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...

weblog.rubyonrails.org

Asset pipeline, HTTP streaming, jQuery as default framework, auto-reversable migrations, identity map for ActiveRecord. Ruby 1.8.x support will...

Today I needed to execute a ruby gem executable with sudo. But, surprisingly, bash would tell me command not found...

Although regular expression syntax is 99% interchangeable between languages, keep this in mind: By default, the dot character (".") does not...

makandra dev

You know that you can collect an array as groups using in_groups or in_groups_of. Maybe you want...

github.com

Whenever is a Ruby gem that provides a clear syntax for writing and deploying cron jobs.

makandra dev

Validations that need to access an associated object may lead to some trouble. Let's exemplify that using this example...

Ruby comes with a class BigDecimal which you can use for arbitrary precision arithmetic. You should use BigDecimal instead of...

When storing floating-point numbers such as prices or totals in an SQL database, always use a DECIMAL column. Never...

nex-3.com

Sass now comes with user-defined functions, keyword arguments, list manipulation. Haml and Sass are now two separate gems.

github.com

A capybara driver that uses WebKit via QtWebKit.