Open a MySQL shell using credentials from database.yml
Open a MySQL prompt without retyping database credentials by using dbconsole with the password flag, optionally for another Rails environment.
Install the Oniguruma gem
Ruby regular expression support may require the Oniguruma engine and its native libraries before gem install oniguruma succeeds.
How to use CSS3 gradients in Opera
Opera 11.10 adds -o-linear-gradient support for CSS3 backgrounds, including angles, multiple color stops, and other CSS color formats.
Use SSL for Amazon RDS / MySQL (and your Rails app)
Encrypted connections between Rails and Amazon RDS MySQL protect sensitive data in transit. mysql and database.yml can be configured to require SSL end to end.
Making the rails 3.1. asset pipeline and asset precompiling work in production mode
Rails 3.1 asset pipeline issues in production can break precompiling, fingerprinting, and stylesheet rendering when Haml, Sass, and Compass are involved.
Removing ANSI color codes from Rails logs
ANSI color codes in Rails logs clutter less and vim; stripping escape sequences with sed produces readable log output or a colorless file.
Usage of RSpec's raise_error
raise_error without an expected exception can pass for unrelated bugs, so matching a specific error class and message makes specs meaningful.
Test that a form field has an error with Cucumber and Capybara
Capybara and Cucumber can assert field validation errors by checking for .field_with_errors around a named form field.
Prevent the selenium webbrowser window from closing after a failed @javascript step
Failed @javascript Cucumber steps can close the Selenium browser before the page state is inspected. Keeping the window open on failure helps debug the created data.
Using heredoc for prettier Ruby code
Heredoc strings keep long Ruby text readable while preserving line breaks and interpolation. <<~ removes indentation; <<- and custom delimiters support flexible multi-line literals.
Change / Update SSL certificate for Amazon Elastic Load Balancer
Rotating an Amazon ELB SSL certificate requires IAM server certificate upload and attaching the new ARN to the load balancer listener.
How to fix: Gems are unavailable although they are installed
Rails or Rake can report missing gems even when they are installed; wrong Bundler configuration or release-directory leftovers often redirect gem lookup to the wrong place.
Use a Ruby method like a block or lambda
Ruby methods can behave like blocks by turning them into callables with Object#method and passing them via & to block-taking methods.
Remove duplicate lines from a text file
Duplicate line removal in text files can be done with uniq -u, which writes only unique lines to an output file.
Runaway Regular Expressions: Catastrophic Backtracking
Certain regular expressions can take extremely long to match because nested repetition triggers catastrophic backtracking, as in (x+x+)+y.
Git: List remote branches
Remote branch names are useful for pulling, checking out, or merging work from another repository. git branch -r lists remote branches; git branch -a shows all branches.
The Skinny on CSS Attribute Selectors
CSS selectors can target elements by attribute values, enabling styling without extra classes or IDs and useful hooks for forms, links, and data attributes.
How Non-negotiable Features Kill Software Products
Pre-sold requirements with no room to renegotiate create unnecessary complexity and lock clients into needs that change over time.
Truncate files to zero length
Set existing files to 0 bytes with truncate -s0; missing files are created, which makes log-file clearing and bulk file reset fast.
Selenium WebDriver 2.5.0, 2.6.0 fails when selecting options from select boxes
selenium-webdriver versions after 2.5.0 can make Capybara fail to choose <select> options even when the option is present, affecting Firefox tests.
Couldn't create database for ...
rake db:create fails when MySQL access or credentials are wrong, often because the configured user lacks permission to create the development database.
Solving "cannot remove Object::ClassMethods"
rake can fail with a misleading cannot remove Object::ClassMethods error when a hidden boot-time exception triggers Rails cleanup instead of the real cause.
Fixing Homebrew "Permission denied" issues
Homebrew can fail on first install when it cannot access /usr/local directories. Fixing ownership lets brew install run normally.
Dealing with Solr's "404 Not Found" response
Solr can start normally yet still return 404 Not Found when its log directory is not writable for the runtime user.