Angular: Caching API responses in Restangular
Restangular can reuse AngularJS $http response cache for individual requests or globally, but stale data requires explicit invalidation.
Draggabilly
JavaScript library for drag-and-drop interactions with more control than native HTML5 support, plus touch and multi-touch behavior for modern browsers.
Angular: Binding an HTML value
Angular requires trusted HTML for ng-bind-html; a custom $sce filter can sanitize values and replaces the removed ng-bind-html-unsafe directive.
How to install fonts in Ubuntu
Add custom fonts to Ubuntu by placing font files in ~/.fonts and refreshing the font cache, or install them through the font preview window.
New Firefox and gem versions for our Selenium testing environment (Ubuntu 14.04+)
Firefox 5.0.1 no longer runs on Ubuntu 14.04, so Selenium test setups need browser and gem updates to keep Rails 2.3 and Cucumber projects working.
Fixing tlmgr cannot setup TLPDB
tlmgr on Debian can fail with “cannot setup TLPDB” when the TeX Live user tree is not initialized, blocking package and configuration management.
Pitfall: ResourceController overwrites where ActiveRecord enqueues
Callback definitions can silently replace each other in ResourceController, unlike ActiveRecord’s queued hooks, so trait-based behavior may disappear.
Accept nested attributes for a record that is not an association
Pass nested form data to a plain model reader such as home_page, without a real association. Works for singular references, with manual record construction and no deletion support.
How to install the `xelatex` binary on Ubuntu 14.04
Missing xelatex causes RTeX::Document::ExecutableNotFoundError during tests; installing texlive-xetex on Ubuntu 14.04 provides the binary.
Prevent LibreOffice from changing standard styles when you format individual characters
Character formatting in LibreOffice can trigger unwanted style changes across the whole document. Disabling AutoUpdate on the affected style keeps direct formatting local.
Scroll a textarea to a given position with jQuery
Textarea cursors and selections do not reliably bring the view to the target position. Focusing a shortened value can force the browser to scroll there.
/usr/ports/converters/ruby-iconv This port is marked IGNORE
FreeBSD Ports may try to upgrade ruby-iconv even though it is ignored for Ruby 2.0 and newer; setting RUBY_VER=1.9 makes the port match the installed Ruby version.
bower-rails can rewrite your relative asset paths
Precompiled CSS breaks relative image and font URLs when asset paths change; bower-rails can rewrite url(...) references into ERB asset helpers before deployment.
JavaScript: How to check if an object is NaN
NaN is difficult to compare in JavaScript because it never equals itself. Object.is() works in ES6; ES5 needs a number type check plus isNaN().
Angular-xeditable :: Edit in place for AngularJS
AngularJS directives for click-to-edit interfaces and editable grids, enabling in-place editing with support for complex forms.
jQuery: Run an event handler only once
Use one(...) for handlers that should fire a single time; it accepts the same arguments as on(...) and removes itself after the first event.
Managing vendor assets in Rails with Bower
Rails asset management becomes easier with bower-rails, using a Bowerfile and rake tasks to install, list, update, and rewrite vendored front-end packages.
Dealing with "TypeError: Converting circular structure to JSON" on JavaScript
Circular references make JSON.stringify fail with TypeError; a custom serializer or safe stringifier is needed to inspect or export object graphs.
Returning an empty ActiveRecord scope
none returns an empty ActiveRecord::Relation for default objects and other cases where no records should match, with a fallback initializer for older Rails versions.
When Sass-generated stylesheets print a Encoding::CompatibilityError
Sass-generated stylesheets can surface Encoding::CompatibilityError after a Rails and Ruby upgrade, often from stale cache files or mismatched UTF-8 and ASCII-8BIT encodings.
Reveal the indexes of an ActiveRecord table
ActiveRecord::Base.connection.indexes(:table_name) returns the database indexes defined for an ActiveRecord table, useful for checking schema performance and uniqueness constraints.
CoffeeScript: How to instantiate a class with an attributes hash
CoffeeScript classes can initialize instance properties directly from an attribute hash, similar to ActiveRecord-style mass assignment. constructor: ({ @name, @email }) -> binds fields automatically.
Sending raw JSON data to a member action in a controller spec
Rails 4 controller specs can send raw JSON in a member action request by passing the JSON body before the route parameters.