How to get the hostname of the current machine in Rails or a Ruby script

Socket.gethostname returns the current machine’s hostname in Rails or Ruby; hostname is a fallback on Unix-like systems, but may include trailing newline or FQDN.

Consul 0.5.0 is faster for admins, allows to define multiple powers at once

Consul avoids unnecessary queries when a power selects all records, speeding up permission checks for admins. power can now define multiple powers in one block.

Customize tokenization of the MySQL FULLTEXT parser

MySQL FULLTEXT tokenization is hard to tune and can split terms unexpectedly, such as at periods. Normalizing input or moving to Solr can avoid parser limitations.

Fix error: undefined method `desc' for #<Foo::Rake::Taskx1234>

A gem can break on newer Rake versions when it calls desc on Rake::Task; upgrading the gem or pinning rake to 0.8.7 avoids the error.

Fix warning: No secret option provided to Rack::Session::Cookie

Rails with recent Rack versions can emit a session cookie security warning when no secret is configured; locking Rack to 1.4.1 works around the issue.

Mac: Turn applications to Full Screen mode from bash

Make Mac apps enter full screen from bash scripts by calling a small helper script; requires Accessibility access and only works with apps that support full screen.

CSS Explain - A tool which calculates CSS selector specificity

Calculates CSS selector specificity for a given selector, helping diagnose why one rule overrides another in the cascade.

will_paginate can paginate plain Ruby arrays

will_paginate can page plain Ruby arrays, returning a paginated array-like object with total_entries and the same pagination controls as ActiveRecord scopes.

Font Awesome 3.0 has been released

Font Awesome 3.0 adds 40 new icons, CSS animation-based spinning, and a smaller file size; the font can be subset to include only needed icons.

Get Your App Ready for Rails 4

Preparing an existing Rails app for Rails 4 involves updating deprecated APIs, dependencies, and configuration before upgrading the framework.

WORDOID - Creative Naming Service

A cozy place to find a short, catchy name for a product, company, or domain.

Rails 4 Countdown to 2013 | The Remarkable Labs Blog

Ruby on Rails 4 adoption will require updates for many web applications. A 31-day series prepares developers for a smoother upgrade.

Compare two jQuery objects for equality

jQuery creates a new wrapper on each $(...) call, so == fails for matching selections. Use .is() to test whether two jQuery objects wrap the same DOM elements.

5 Design Tips Every Developer Should Know

Visual polish can improve small-team projects and make software feel more successful. Five basic art and design principles help reduce ugly interfaces and weak presentation.

The Shapes of CSS

Pure CSS can render many decorative shapes with a single HTML element, avoiding extra markup for icons, badges, and UI flourishes.

Error installing ffi gem

Installing ffi can fail when the system lacks the libffi development package. Installing libffi-dev on Debian-based systems resolves the missing header/library dependency.

equalize.js

jQuery plugin for matching element heights or widths to create uniform layouts in grids, cards, and columns.

King of Nothing, the DCI paradigm is a scam

Frustration with DCI and Clean Ruby centers on ambitious promises that feel unfinished and oversold in large Ruby on Rails applications.

Git blame: How to ignore white-space modifications

git blame -w ignores whitespace-only changes, keeping authorship attribution on the original code instead of indentation edits. git diff -w does the same for comparisons.

Why your browser loses cookies when following hyperlinks from an Excel spreadsheet or Word document

Microsoft Office prefetches hyperlinks and opens the browser without cookies, so redirected links can lose session state. Returning 200 OK to Office user agents avoids the redirect path.

randym/axlsx · GitHub

Create XLSX spreadsheets in Ruby with charts, images, styling, auto column sizing, and schema validation; handles large files and eases migration from spreadsheet.

Consul 0.4.2 improves querying of nil powers

Consul 0.4.2 fixes unexpected behavior when querying powers that return nil, making predicate and bang methods return false or raise Consul::Powerless consistently.

occ/TraceKit · GitHub

JavaScript stack traces differ across browsers and often need normalization after unhandled exceptions. TraceKit provides a consistent representation for IE, Firefox, Chrome, Safari, and Opera.

Force GitHub Pull Requests to update the diff against its target branch

GitHub may keep stale PR diffs after merged commits from another branch remain listed. A forced no-op push can refresh the comparison against the target branch.