Internet Explorer will download CSS files twice, if referenced via scheme-less URLs
Internet Explorer 7 and 8 fetch stylesheets twice when http or https is omitted, so protocol-relative URLs are unsafe for CSS links on public sites.
Firefox: Inspecting mixed content warnings (and how to enable them)
Mixed-content requests can undermine SSL pages and may go unnoticed unless Firefox warnings are enabled. about:config and the Web Console help locate insecure http:// resources.
Rails 2.3.x sometimes renders localized views with the wrong content type
Rails 2.3.5 can send an invalid Response content-type for localized view templates, causing browsers to receive de.html instead of text/html.
Cucumber: Wait for any requests to finish before moving on to the next scenario
Selenium/Cucumber scenarios can finish before browser requests and redirects are done, leaving the session busy and breaking later steps and hooks.
CSS3 Animated Loading Bar
Pure CSS progress indicators can replace animated GIFs, JavaScript, or Flash for lightweight loading animations in web interfaces.
IcoMoon icons
Large free vector icon set with custom SVG support and export as icon font or PNGs; a paid upgrade raises the limit to 925 icons.
Regex pattern to validate email addresses
Email address validation with a regular expression is tricky: -free local parts, -unsafe shorthand like \w, and practical restrictions differ from the formal standard.
Ruby: Extract the hostname from a URL
Extracting the web address host from a string can fail on invalid input. URI.parse returns the hostname, and URI.join can rebuild the base URL without path, query, or fragment.
Git: Show current branch name only
Large branch lists make it hard to spot the active Git branch; git rev-parse --abbrev-ref HEAD returns only the current branch name.
Haml: Fix problem with HTML-escaped single quotes in text fields
Haml 3.1.2 can double-escape single quotes in FormBuilder#text_field values, producing David's Chapter; upgrading to 3.1.5 or newer fixes it.
Advice: Reduce scopes with joins to simple IN-queries
JOIN-heavy scopes become brittle when callers chain more conditions or associations. Converting them to a simple IN query preserves chaining and avoids unexpected SQL side effects.
ActiveModel::Errors inherits from hash and behaves unexpectedly
ActiveModel::Errors looks like a Hash but iterates arrays as separate pairs, which can break custom handling of multiple validation messages.
Making Little Classes out of Big Ones
A too-large class is harder to understand, test, and change. Several refactoring approaches break it into smaller responsibilities.
Manually requiring your application's models will lead to trouble
Manually requiring Rails models can load classes twice and trigger duplicate validations or other subtle test failures. Let Rails autoload models or require them by the same path Rails uses.
grosser/rspec-instafail
Immediate feedback for failing RSpec examples while passing ones continue to appear as green dots. Uses rspec/instafail with RSpec::Instafail formatting.
CSS: Emulate linear gradients with inset box shadows
Linear gradients can be awkward for glossy or dimensional effects and have uneven browser support; inset box shadows can mimic fixed highlights or shadows more reliably.
CSS: Emulate borders with inset box shadows
Inset box-shadow can fake borders without doubled edges on nested elements and can create multiple frame-like borders on one element.
Automatically strip all string fields of an ActiveRecord
Trailing whitespace in string inputs causes duplicate-looking records and uniqueness bugs. A model trait strips leading and trailing spaces from :string fields before validation.
floere/phony
Formats and splits phone numbers worldwide, including many country-specific variations and edge cases, for normalization and consistent handling.
7 Ways to Decompose Fat ActiveRecord Models - Code Climate Blog
Fat ActiveRecord classes accumulate business logic over time, creating maintenance problems and callback hell in large apps. SRP keeps persistence objects focused and easier to change.
RSpec: Change the type of a spec regardless of the folder it lives in
Rails specs can get controller, model, or request helpers from directory-based inference; :type forces the desired context even when a file lives elsewhere.
jsTimezoneDetect
Determines a user's timezone in JavaScript when browser and system settings may be unreliable.
mattheworiordan/capybara-screenshot
Captures browser screenshots on demand or automatically when tests fail, making visual debugging of Capybara runs easier.
Fixing errors with state_machine when excluding states
StateMachine can raise undefined method '-' for #<StateMachine::BlacklistMatcher> when subtracting excluded states from all; use a union to build the allowed source states.