Careful when calling a Ruby block with an array
Ruby procs can unexpectedly unpack arrays into multiple block parameters, while lambdas enforce arity and raise ArgumentError instead.
Embed Font Awesome icons from your CSS
Font Awesome icons can be used directly from Sass without adding them to the DOM, using icon constants and mixins for :before or :after content.
CarrierWave: Don't use #url when you mean a file path
CarrierWave url escapes non-ASCII characters while path returns the local filesystem path; use the right method for links, images, and send_file.
Build cronjobs or list next dates
Cron schedules are easy to mistype, and invalid syntax only appears when crontab tries to install the file. CronMaker helps build valid expressions and check them quickly.
Ruby: How to measure code execution time in an IRB or Rails console
IRB and Rails console sessions can time code execution directly with measure; older versions can use Benchmark.measure for manual timing.
Use the Ruby debugger on Rails 2 script/runner scripts
Rails 3+ script/runner debugging needs rdebug because --debugger is gone; Ruby-debug must be available and required to enter the debugger from a script.
Bash: How to only do things in interactive shells
Printing from .bashrc can break non-interactive commands like scp; checking for an interactive shell keeps startup output limited to terminal sessions.
Howto provide a single page preview for PDF & TXT with carrierwave
Single-page previews for PDF and TXT uploads can be generated with CarrierWave and RMagick by rendering the first page as a JPG thumbnail.
How to silence "I18n.enforce_available_locales" deprecation warnings
Rails 3.2.16 and 4.0.2 can emit deprecation warnings for invalid I18n locales after upgrades; I18n.enforce_available_locales controls whether unsupported locales are validated.
Ruby 1.8: SimpleDelegator is very slow
SimpleDelegator on Ruby 1.8 can be prohibitively slow because it defines methods for every target method; DelegateClass(User) is often much faster for fixed model types.
Spreewald 0.8.0 brings a file attachment step
File attachments can be assigned to model attributes and related objects in Cucumber scenarios, including polymorphic associations and timestamp setup.
Virtual attributes for integer fields
Virtual integer attributes in Rails can lose form selections and type casting on validation roundtrips; an auto-coerced accessor keeps values as integers or nil.
howto fix spreewald issue „database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)“
Spreewald fails with ActiveRecord::AdapterNotSpecified when database.yml defines Cucumber settings instead of test settings. Renaming the environment entry to test resolves the adapter error.
Rubymine >= 5.4.3.2.1 supports keybinding for "Goto next/previous splitter"
RubyMine 5.4.3.2.1 can bind hotkeys for moving between split panes, useful for keyboard-driven pane switching.
How to find out the type of a model's attribute
Use ActiveRecord metadata to inspect a model field’s database type, such as integer, boolean, or datetime, without querying the value itself.
Alan Klement: Replacing The User Story With The Job Story
Feature definition for new teams and early products is often unclear when customer motivations and expected outcomes are hard to align. Job Stories apply jobs-to-be-done thinking instead of user stories.
pickadate.js
Mobile-friendly, responsive jQuery date and time input picking without jQuery UI; the associated field cannot be typed into directly.
An Illustrated Guide to SSH Agent Forwarding
SSH agent forwarding lets remote servers use your local SSH keys without copying them, reducing key exposure while enabling convenient hop-through access.
How to subscribe to Ruby security updates
Ruby security advisories and MRI release updates are published on ruby-lang.org, but no direct email subscription exists. An RSS-to-email service can deliver them by mail.
kickstarter/rack-attack
Rack middleware that blocks abusive clients and rate-limits requests with whitelists, blacklists, throttling, and request-based tracking.
MySQL: How to clone a database
Duplicate a MySQL database under a new name, including tables and data, by dumping the source and restoring it into a fresh schema.
Slice a nested hash
Recursively select whitelisted keys and nested subkeys from a hash with deep_slice, preserving only the allowed structure.
ftlabs/fastclick
Fast mobile taps suffer a 300ms click delay in browsers, making apps feel sluggish. FastClick removes the delay without changing existing click logic.
Force absolute URLs for parts of a view or controller
Generate full url_for links only within selected view or controller blocks, with temporary opt-out and optional fixed host. Asset URLs remain unchanged.