rake spec + rails_admin = weirdly failing specs

rails_admin specs can pass with rspec but fail under rake spec; setting ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'false' in spec_helper restores the initializer.

How to deal with: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type [...] at

Puppet catalog compilation can fail with ArgumentError: Invalid resource type when plugin sync or environments are misconfigured. Missing Ruby files in /var/lib/puppet/lib can trigger the error.

Get the initial username which you used to login to your Linux system

Find the currently logged-in Linux user with whoami; use it in .bashrc to set different Bash prompts for root and normal users.

Difference between class_inheritable_attribute and class_attribute | martinciu's dev blog

class_attribute behavior in Rails can differ from the removed class_inheritable_attribute, especially when inheritable class state is needed across subclasses.

Rack dies when parsing large forms

Rack can reject large nested forms by miscounting input fields against its parameter limit, causing low-level Ruby errors or Rails error pages.

RSpec claims nil to be false

RSpec be_false matches nil, so a false check can pass unexpectedly. Use == false when the value must be exactly false.

Deal with error: Expected foo_trait.rb to define FooTrait

Rails autoloading can surface a misleading Expected foo_trait.rb to define FooTrait error after a mistake in an unrelated trait, making the real failure hard to locate.

Some useful Unicode chars

Handy Unicode symbols on Ubuntu help with quotation marks, dashes, and ellipsis input. Character map and compose key support make special characters easy to enter.

BigDecimal#inspect for people who aren't cyborgs

BigDecimal#inspect prints an unreadable internal form; returning BigDecimal#to_s makes values display like normal numbers.

Updated: Ruby doesn't sort strings with German umlauts correctly

Ruby string ordering can misplace German umlauts; natural sorting and locale-aware collation address the issue.

Don't use Ruby 1.9.2

Ruby 1.9.2 loads files very slowly, making Rails startup and test runs painfully long. Upgrading to 1.9.3 removes the bottleneck.

Order of multiple "rescue_from" statements might be unexpected

Multiple rescue_from handlers can shadow earlier ones, so a specific error handler may never run when a broader exception handler is declared later.

GNOME3 Notifications For Skype ~ Web Upd8: Ubuntu / Linux blog

GNOME desktop integration improves Skype pop-up alerts with better visibility and a cleaner look, including support for GNOME 2.

Do not use "find" on Capybara nodes from an array

Capybara find can return incorrect matches when called on nodes from all, especially with text filters. Use a full selector on the page to scope the search reliably.

Use Nokogiri to convert CSS to XPath

Nokogiri can turn readable CSS selectors into XPath expressions, avoiding hand-written XPath for simple queries while keeping access to more powerful matching when needed.

LibreOffice won't embed most fonts into PDFs (with fix)

LibreOffice often omits font embedding in exported PDFs, making shared documents and slide decks unreadable on other systems. Reprinting through a PDF printer is a workaround.

Rails 2's CookieStore produces invalid cookie data, causing tests to break

Recent Rails 2 CookieStore versions can emit malformed Set-Cookie headers with blank lines, breaking Cucumber integration tests when cookies are written more than once.

How much should I refactor?

Balancing refactoring with complexity is difficult when new patterns promise cleaner, more testable Rails code. Choosing when to apply them keeps code maintainable without overengineering.

LibreOffice Impress: Distorted text letters in presentation mode

Text letters appear distorted in presentation mode in LibreOffice Impress; upgrading to 3.5.3+ or disabling hardware acceleration can fix rendering issues.

CSS3 Media Queries have reached recommendation status

Media Queries became a W3C Recommendation on June 19, 2012, marking CSS3 responsive design support as a stable web standard.

Using ENUMs with Rails - See John Code

Rails can swap a varchar column for an ENUM without changing application code, reducing risk when tightening database constraints.

Show hint in HTML 5 text fields

Placeholder text in HTML5 text fields gives users a hint that disappears on focus, but support depends on modern browsers.

Updated: Puppet 2.6.x on Ubuntu lucid 10.04

Installing a specific Puppet release on Ubuntu Lucid avoids distro package drift and keeps configuration management behavior predictable.

Calendar quarter calculations in Ruby and MySQL

Quarter boundaries and quarter numbers in Ruby and MySQL can be derived from a date with beginning_of_quarter, end_of_quarter, QUARTER(), or simple month division.