Consider this class: class Foo private def test puts "Hello" end end While you can say create a block to...

web.archive.org

TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...

Safari & Chrome Use $x() in your console: $x('//span') # selects all span elements Firefox There's an add-on.

github.com

MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...

If you open a pop-up window [1] in your Selenium tests and you want to close it, you can...

gist.github.com

Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string...

makandra dev
blog.mozilla.org

Prepare to explain customers what changed if your application renders PDF documents to users.

If others on a call (Skype, SIP, ...) can not hear you loud enough, your volume levels are probably too low...

Microsoft provides virtual machines for different Internet Explorer versions. The images are available for various virtualization solutions, including VirtualBox...

Spreewald now comes with a step that tests if a form field is visible: Then the "Due date" field should...

Consul 0.6.1+ gives your Power class a number of static methods that behave neutrally in case Power.current is nil. This...

makandra dev
jakiestfu.github.com

Behave.js is a lightweight library for adding IDE style behaviors to plain text areas, making it much more enjoyable to...

Calling bundle update GEMNAME will update a lot more gems than you think. E.g. when you do this...

Calling bundle update (without arguments) updates all your gems at once. Given that many gems don't care about stable...

Apache HTTP server benchmarking tool (ab) is a nice tool to test performance on sites delivered by HTTP. If the...

kernel.org

If you say git stash, your stashed changes will be identified with an automatically generated message: $ git stash

Every time you call $(...) jQuery will create a new object. Because of this, comparing two jQuery collections with == will never...

makandra dev
github.com

Axlsx is an incredible gem to generate "Office Open XML" spreadsheet files (XLSX). Does not break on large spreadsheets and...

TLDR: In tests you need to clean out the database before each example. Use :transaction where possible. Use :deletion for...

As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...

makandra dev

The bash offers control over the behavior of autocompletion. The most primitive example is this (just run it in your...

The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...

When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only...

makandra dev

Basic error pages To add a few basic styles to the default error pages in Rails, just edit the default...