There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...

When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...

You should test the callback methods and its correct invocation in two separate tests. Understand the ActiveRecord note before you...

github.com

By default, Cucumber uses mocha. This note shows to use RSpec stubs and mocks instead. Rspec 1 / Rails 2

makandra dev

sudo apt-get install i8kutils Reboot You can now run the i8k tools such as i8kmon Setting the fan speed...

Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)

github.com

There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define

nickstakenburg.com

Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to...

When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...

regular-expressions.info

You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...

So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...

makandra dev

This may be awkward to set up, but will work once you're done. Fun facts:

With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...

makandra dev

To test concurrent code, you will need to run multiple threads. Unfortunately, when you use blocking system calls (e.g. locks...

When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the...

web.archive.org

This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as...

makandra dev

Basic configuration Please keep this config simple. It should be a starting point for new developers learning Git. [user]

tech.puredanger.com

Following up on my previous post, this is the second installment of Java Concurrency Bugs. In this post, we’ll...

pluginaweek.org

After 2 1/2 years of blood, sweat, tears, and the occasional Jägermeister, I’m finally officially announcing a project I...

axonflux.com

/^([\w!#$\%\&'*+-\/=\?\^`{|}\~]+.)*[\w!#$\%\&'*+-\/=\?\^`{|}\~]+@((((([a-z0-9]{1}[a-z0-9-]{0,62}[a-z0-9]{1}) [a-z]).)+[a-z]{2...