How to ignore new files or changed files in git
Untracked or modified files clutter Git status and can be hidden locally or for everyone with ignore rules and git update-index flags.
How to define a custom context menu within HTML (Firefox 8+)
Custom right-click menus can be built with HTML in Firefox 8+ instead of relying on browser defaults.
Configuration for Rails, the Right Way
Rails 3 lets applications define custom configuration elements directly, avoiding extra gems or plugins for miscellaneous settings.
Create a new gemset with RVM
Separate gemsets let each Ruby application use its own installed gems. rvm use 1.8.7-p323@makandra_project_xy --create creates and switches to a new gemset.
Error "execution expired (Timeout::Error)" when using Selenium and Webmock
Bulk test runs can fail with execution expired (Timeout::Error) when Selenium and WebMock interact; upgrading WebMock to 1.7+ resolves the timeout issue.
Excel files can't hold more than 65535 rows per worksheet
Classic XLS worksheets stop at 65,535 rows; the Spreadsheet gem writes only XLS, so larger exports need split sheets, extra columns, or XLSX output.
Find geocoded records that are close to a location (radius search)
Find records near a latitude/longitude pair by calculating distances in SQL or using acts_as_geocodable for radius-based queries.
"Require group" doesn't work with Ubuntu's default Apache installation
Require group in Ubuntu’s default Apache setup fails silently without the group authentication module. Installing libapache2-mod-auth-sys-group enables group-based access control.
Run a script on the server
Set the Rails environment explicitly when running server-side scripts to avoid using the wrong database or configuration. Rails 2 uses script/runner; Rails 3 uses rails runner.
Declare different CSS background-images for different locales
Language-specific styling can switch background images per locale by using the HTML lang attribute in views and matching selectors in stylesheets.
How to manage Thunderbird mailing lists
Thunderbird mailing lists group contacts for easier recipient selection and broadcast email to every member from one address-book entry.
Preparing your test database: mind the differences
Test database setup can drift from development when schema dumps omit SQL-specific details; choose the right Rake task to keep structure, charset, and collation aligned.
See with tig which git commits touch a file or files or folders
tig can filter commits by path, helping find which changes touched a file, folder, or wildcard pattern without scanning every revision.
state_machine: Test whether an object can take a transition
Check whether an object can perform a state transition before calling it. can_transition_ab? only verifies that a matching transition exists; validations may still block it.
Login forms: Disable browser prompt to remember the password
Browsers may prompt to save passwords on login forms; setting autocomplete="off" on the form suppresses that prompt.
Large forms are slow on the iPad
Very large forms can become unresponsive on iPad, with touch controls taking seconds to react. Showing only a limited set of inputs at once avoids the slowdown.
Be careful with "memoize"
ActiveSupport::Memoizable can return wrong results when a memoized method is called with arguments, because true may trigger recomputation instead of being passed through.
jQuery 1.7 Released
jQuery 1.7 introduces on and off for event handling, deprecates bind, delegate, and live, and improves delegated event performance.
Ruby: Downloading files from the Internet
Downloading a remote file in Ruby can be done with open-uri; HTTP Basic Authentication credentials work when the source is protected.
Multi-line Ruby block in Haml
Haml can render multi-line Ruby code with the :ruby filter when puts sends generated output into the template response.
"Show me the page" fails to open a browser window
Show me the page can fail to launch a browser window when launchy is outdated; upgrading to a newer version resolves the error.
Rails 3.1 error message: Could not find a JavaScript runtime
Fresh Rails 3.1 apps can fail on boot when ExecJS cannot locate a JavaScript runtime, and adding a runtime gem to the Gemfile removes the error.
Web font embedding requires new CSS for IE9
Internet Explorer 9 needs updated @font-face syntax for embedded web fonts; older Font Squirrel CSS can fail until the EOT source includes the ?#iefix workaround.
How the Clearance gem remembers and clears sessions
Persistent sign-in via remember_token keeps users logged in across browser restarts, while logout invalidates every matching session immediately by rotating the token.