Sublime Text 2 recognize underscore templates as HTML

Go to “Browse Packages” in the menu (where the menu item is depends on your platform). Open up HTML/HTML.tmLanguage Change this line (line 286 in my HTML.tmLanguage): <string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)</string> to this: <string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)(?!.*type=[“‘]text/template[‘”])</string> Now any script tags with type=”text/template” or type=”text/template” will render as html and not javascript.

lodash Filter collection using array of values

If you’re going to use this sort of pattern a lot, you could create a mixin like the following, though, it isn’t doing anything fundementally different than your original code. It just makes it more developer friendly. _.mixin({ ‘findByValues’: function(collection, property, values) { return _.filter(collection, function(item) { return _.contains(values, item[property]); }); } }); Then you … Read more

Differences between Lodash and Underscore.js [closed]

I created Lodash to provide more consistent cross-environment iteration support for arrays, strings, objects, and arguments objects1. It has since become a superset of Underscore.js, providing more consistent API behavior, more features (like AMD support, deep clone, and deep merge), more thorough documentation and unit tests (tests which run in Node.js, RingoJS, Rhino, Narwhal, PhantomJS, … Read more