Use <input type="number"> for numeric form fields
Numeric form fields on mobile get digit-focused keyboards, locale-aware decimal display, and consistent point-based values in JavaScript and form submission.
CI Template for GitHub Actions
GitHub Actions CI template for Rails apps with parallel RSpec, RuboCop, ESLint, license checks, security scanning, and merged coverage reports.
Configuring Git with .gitconfig
Simple Git configuration for new developers: aliases, merge and rebase defaults, better diffs, and GitLab push shortcuts.
Where to keep project files that should not go to Git
Keep project-related notes, logs, and dumps outside version control in a dedicated related-files/ directory, ignored globally with ~/.gitignore.
Firefox ESR Release Calendar
Firefox ESR keeps a fixed browser version for a year with security backports only, while overlapping releases give enterprises three months to test and migrate.
How to configure Selenium WebDriver to not automatically close alerts or other browser dialogs
Selenium WebDriver dismisses browser dialogs by default and can close alerts before tests react. Setting unhandled_prompt_behavior to ignore leaves prompts open until handled.
Better numeric inputs in desktop browsers
Desktop number fields accept scientific notation, arrow-key changes, wheel scrolling, and stray letters, causing accidental edits and validation errors.
Action Mailer Previews
Previewing Rails emails in the browser catches layout and content issues before delivery and helps keep mailer output aligned with expectations.
Concurrency issues with find-as-you-type boxes
Live search boxes can show stale results when AJAX responses arrive out of order, causing flashing and mismatched suggestions. Serializing requests or discarding outdated responses avoids the race condition.
Include keystrokes in a screencast
Show pressed keys on screen for screencasts or screen sharing with screenkey, and adjust the overlay through its settings window.
Best practices: Writing a Rails script (and how to test it)
Rails one-off scripts need idempotence, transactions, transparency, and robust error handling; isolating logic from input also makes them testable.
Accessing JavaScript objects from Capybara/Selenium
Capybara and Selenium can access only browser globals, so exported JavaScript modules fail in evaluate_script unless the component instance is attached to the element.
Git shortcut to fixup a recent commit
git commit --fixup needs a target commit SHA, making fixup commits awkward to create; an fzf alias can select the commit interactively before git rebase -i --autosquash.
When reading model columns during class definition, you must handle a missing/empty database
Class definition code that inspects model columns can crash startup when the database is missing or empty, blocking db:create and db:migrate.
Bash: How to count and sort requests by IP from the access logs
Count and sort request frequencies by client IP in access logs with a short awk pipeline for quick traffic checks and abuse spotting.
Bash: How to grep logs for a pattern and expand it to the full request
Find all Rails log lines for matching requests by extracting request IDs and re-grepping the full log, avoiding interwoven output from concurrent requests.
Rails: Testing the number of database queries
N+1 queries and excessive eager loading can be caught by asserting exact database query counts in specs with the make_database_queries RSpec matcher.
Opening a zipped coverage report with one click
Make zipped coverage reports open directly in a browser from the file manager, with a fallback to the normal archive opener for other .zip files.
Element.animate() to animate single elements with given keyframes
Animate HTML elements with Element.animate() from the Web Animations API; control timing, playback state, and completion without extra libraries.
SASS: Adding, removing and converting units
Sass unit arithmetic makes it easy to attach, strip, and convert measurement units when working with CSS values and timing data.
When loading Yaml contents in Ruby, use the :freeze argument to deep-freeze everything
YAML.safe_load and YAML.safe_load_file can deep-freeze parsed YAML with freeze: true, keeping configuration data fully immutable; ... .freeze leaves nested objects mutable.
Creating a self-signed certificate for local HTTPS development
Local HTTPS development often needs a trusted certificate for browser access. Self-signed or CA-signed certificates let localhost or wildcard hostnames run without warning dialogs.
How to search through logs on staging or production environments
Finding a request in staging or production logs often requires searching several servers and archived files; grep or zgrep can query current and zipped logs.
How to make your application assets cachable in Rails
Rails asset URLs need fingerprints or timestamps to let browsers cache images, stylesheets, and scripts long-term without serving stale files after updates.