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

jqueryui.com

This will eventually be integrated into jQuery UI with the multiple: true option, but right now this is the way...

Don't use should validate_format_of(...) because that matcher works in weird ways. Use the allow_value matcher instead...

Use this if you want to show or hide part of a form if certain options are selected or boxes...

makandra dev
rjb.rubyforge.org

rjb is a bridge software. It connects Ruby and Java.

ubuntuforums.org

Keyboard layout reverting to US on (every) reboot Cause: I found the same problem, but only on my wife...

regular-expressions.info

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

github.com

jamesgolick / resource_controller at Github module ResourceController module Actions def index load_collection before :index response_for :index end

The Git stash does not work like a one-slot clipboard and you might shoot yourself in the foot if...

makandra dev

To pause and send a task to the background ctrl+z to reactivate the task fg to run task in...

Use the attached initializer to do stuff like this str = "abc" str.imbue(:foo => 'foo value', :bar => 'bar value')

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

Capybara does not play nice with sites that have some actions protected by SSL, some not. A popular way to...

makandra dev
github.com

Our awesome collection of rspec helpers (formerly known as "spec_candy.rb") is now available as a gem. It works, it is...

makandra dev

The following counts all the lines in all *.rb files in the app directory. Run several of these commands to...

makandra dev

Show all sockets (Unix & TCP/UDP), both listening and established ones: netstat -anp To limit the output e.g. to listening TCP...

This is called "cherry-picking". git cherry-pick commit-sha1 Note that since branches are nothing but commit pointers, cherry...

To delete a local branch git branch -d the_local_branch To remove a remote branch (if you know what...

stackoverflow.com

Reverting a commit means creating a new commit that undoes the old changes. Imagine the following commit history:

gnuu.org

YARD 0.6 adds the ability to serve documentation for gems as well as the current project with yard server. Just...

makandra dev
ruportbook.com

Ruport’s acts_as_reportable module provides support for using ActiveRecord for data collection. You can use it to get...

When doing a query like this: SELECT id FROM users WHERE (users.id IN (899,1084,1095,100,2424,2429,2420...

weblog.rubyonrails.org

Rails 3.0 has been underway for a good two years, so it’s with immense pleasure that we can declare...

github.com

An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...