Does LESS have an “extend” feature?

Yes, Less.js introduced extend in v1.4.0. :extend() Rather than implementing the at-rule (@extend) syntax used by SASS and Stylus, LESS implemented the pseudo-class syntax, which gives LESS’s implementation the flexibility to be applied either directly to a selector itself, or inside a statement. So both of these will work: .sidenav:extend(.nav) {…} or .sidenav { &:extend(.nav); … Read more

Extending an existing jQuery function

Sure… Just save a reference to the existing function, and call it: (function($) { // maintain a reference to the existing function var oldcss = $.fn.css; // …before overwriting the jQuery extension point $.fn.css = function() { // original behavior – use function.apply to preserve context var ret = oldcss.apply(this, arguments); // stuff I will … Read more

Rails extending ActiveRecord::Base

There are several approaches : Using ActiveSupport::Concern (Preferred) Read the ActiveSupport::Concern documentation for more details. Create a file called active_record_extension.rb in the lib directory. require ‘active_support/concern’ module ActiveRecordExtension extend ActiveSupport::Concern # add your instance methods here def foo “foo” end # add your static(class) methods here class_methods do #E.g: Order.top_ten def top_ten limit(10) end end … Read more