Why Ruby Class Methods Resist Refactoring

Class methods are harder to refactor into smaller units because they cannot hold state, so shared context must be threaded through repeated parameters.

Obfuscating data in Rails applications for screenshots and demonstrations

Real data makes demos and screenshots look convincing, but names and values need masking to avoid exposing sensitive information. Faker can quickly replace personal details with plausible placeholders.

Introducing ActiveType

A gem supports the form model approach for managing form data and validation with a cleaner object-oriented structure.

IE10 / IE11 Metro mode: How to switch tabs or show the address bar

IE10 and IE11 Metro mode can hide the tab bar and address bar when used with a mouse; right-clicking restores the controls.

Thread Safety With Ruby — Luca Guidi

Ruby threads share a writable heap inside one VM process, so unsynchronized access can cause unexpected behavior in concurrent code.

CSS: Vertically center with margin: auto

Absolute positioning with margin: auto centers an element vertically and horizontally inside a relative container, if the element fits within the available space.

Showcases

Directory of popular GitHub projects for discovering widely used repositories and tools.

Why your previous developer was terrible

Judging legacy code by today’s needs hides the uncertainty faced during initial development, where many architecture and technology choices were made with incomplete information.

BrowserStack has browser plugins for local testing

Private and internal servers can be tested through the BrowserStack cloud without exposing them publicly, even behind firewalls, proxies, or Active Directory.

How to remove/disable the automatic XSS protection helper html escaping for Rails 3

Rails 3 automatically escapes helper output to prevent XSS, but some views need raw HTML instead. Disabling that protection changes how helper values are rendered and can reintroduce injection risk.

Mouse wheel + Shift key = horizontal scrolling

Holding Shift while using the mouse wheel can scroll horizontally on Ubuntu, and many applications support it.

Alternatives to drop-down menus

Drop-down menus can hide choices, slow selection, and be awkward on mobile; radio buttons, checkboxes, autocomplete, and segmented controls often work better.

Count number of weekdays between two dates

Count weekdays between two dates in Ruby by iterating over a Date range and filtering Monday through Friday.

Ruby on Rails 4 and Batman.js

Batman.js is a lightweight JavaScript MVC framework with a Rails-friendly style for building small client-side apps and blog tutorials.

JavaScript: How to log execution times to your browser console

Measure JavaScript code duration in the browser with console.time and console.timeEnd, including asynchronous flows and separate code locations. Works in modern browsers and recent Internet Explorer.

Techniques for authentication in AngularJS applications

Authentication and access control in AngularJS apps often need a clear client-side pattern for current user state and protected views.

Why belongs_to/has_many cannot overwrite methods with the same name

ActiveRecord association macros do not replace existing instance methods with the same name, so custom methods can still shadow belongs_to and has_many accessors.

ActiveRecord 2.3: Nested attribute changes disappear

ActiveRecord 2.3.x can reload has_many nested associations and discard unsaved form changes during validations, callbacks, or rerendered error pages.

Firefox: Remove dotted border from focused buttons

Firefox renders a dotted inner border on focused form buttons; removing it with ::-moz-focus-inner cleans up the appearance but reduces keyboard focus visibility.

Papertrail - Store each models version in a separate table

Keep versioned records in a dedicated table with PaperTrail, using a custom version class such as PostVersion for each model.

Collection of Rails development boosting frameworks

Rails app setup and admin scaffolding can speed up project bootstrapping, data management, and CRUD interfaces with templates and generators.

Bash: Heavy headings for CLI

Colored full-width headers in the terminal help separate CLI output and highlight sections using ANSI escape codes in Bash or Ruby.

Some nifty Rails Rake tasks

Useful Rails rake tasks expose code statistics, comment tags, and environment details for quick project inspection.

How to force a client-side refresh on a new favicon

Browsers cache favicons aggressively, so changing a site icon often requires a new URL or fingerprinted asset to make visitors see the update.