Render a view from a model in Rails
Render Rails views outside a request for PDFs, email attachments, or background reports using ApplicationController.render or render_to_string.
RubyLTS
Long-term support fork of Ruby 1.8 that keeps receiving security updates for legacy systems.
Remote Debugging on Android - Chrome DevTools
Chrome DevTools can inspect and debug pages running on a mobile Android device from a desktop machine, preserving familiar tooling for on-device analysis.
angular/angularjs-batarang
Chrome WebInspector extension for debugging AngularJS apps and tracking down performance bottlenecks.
Many box shadows will make your app unusable on smartphones and tablets
Heavy box-shadow usage can freeze smartphones and tablets for seconds after user actions; disabling shadows on touch devices avoids costly rendering.
Git: How to remove ignored files from your repository's directory
git clean -x removes ignored files from the working tree; -n previews changes and -xdf deletes ignored files and directories, including local config files.
Rails: Disable options of a select field
Rails select helpers can disable specific options by value, preventing choice of unavailable entries in forms.
Cucumber: Check if a select field contains a disabled option
Capybara and Cucumber can verify that a select box includes a disabled choice, using an XPath check on the matching option element.
exception_notification 3.0.0+ lets you send errors as HTML e-mails
exception_notification can send error reports as simple HTML emails instead of plain text, improving readability while still including a text-only fallback.
exception_notification 4.0.0+ makes it easier to ignore errors, crawlers
exception_notification 4.0.0+ adds options to filter crawler noise and ignore selected exceptions, keeping alerts actionable instead of a stream of routine failures.
RubyMine detects syntax errors where there are none
RubyMine may report false syntax errors, and resetting the IDE settings can clear the issue.
Webservice to mock HTTP responses
Need a simple way to fake server replies during development when external APIs are unavailable or unreliable.
The Chokehold of Calendars
Calendars often turn work into a chain of interruptions, leaving little protected time for deep focus. Intentional scheduling can restore control over the day.
Consul 0.9 lets you optimize records checks
Record-level permission checks can be optimized by replacing scope lookups with a direct predicate, avoiding database ID scans for large collections.
Maker's Schedule, Manager's Schedule
Programmers lose more time to meetings because creative work needs long, uninterrupted blocks, while manager-style schedules fragment the day.
Cryptic Ruby Global Variables and Their Meanings
Ruby’s dollar-prefixed globals can make obscure code hard to read; knowing ARGV, process status, PID, and regex match variables helps decode them.
Short lambda syntax in Ruby 1.9
Ruby 1.9 adds a compact -> syntax for lambdas, making anonymous function definitions shorter while staying equivalent to lambda { |x| ... }.
Do not try to "slice" on an ActionController::CookieJar
ActionController::CookieJar looks like a Hash, but slice fails when selecting cookie subsets because Hash#slice instantiates the wrong class.
Bash: How to generate a random number within given boundaries
Generate bounded integers in Bash using $RANDOM; simple modulus limits the range, but it biases results toward lower values.
ActionView::Template::Error (dump format error for symbol(0x6d))
Selenium tests can fail with ActionView::Template::Error and a dump format error for a symbol, often caused by stale cached files in tmp/cache.
Switch to a recently opened tab with Cucumber
I switch to the new browser tab lets Selenium-enabled tests handle links that open a new tab or window, such as link_to(..., :target => '_blank').
iOS 5 "position: fixed" and virtual keyboard issues
On iPad in iOS 5, the onscreen keyboard can force position: fixed elements to behave like position: static, breaking forms and search fields.
Batch-process text files with ruby
In-place batch editing of many text files with plain Ruby can replace patterns across files without a separate script runner.
List keys stored in memcached / Amazon AWS ElastiCache server
Memcached keys can be enumerated by querying slab statistics and dumping cached items, including AWS ElastiCache instances exposed on port 11211.