Packery, Gumba, watch-array

2013-04-29 00:00:00 +0100 by Alex R. Young



Victor sent in Packery (GitHub: metafizzy / packery, License: MIT/Commercial, bower: packery) from Metafizzy, which is a bin packing library. It organises elements to fit around the space available. Certain elements can be "stamped" into a specific position, fit an ideal spot, or be draggable.

Packery can be configured in JavaScript using the Packery constructor function, or purely in HTML using a class and data attributes. jQuery is not required, but the project does have some dependencies, so the authors recommend installation with Bower.

The project can be used under the MIT license, but commercial projects require a license that starts at $25.


Gumba (GitHub: welldan97 / gumba, License: MIT, npm: gumba) by Dmitry Yakimov is CoffeeScript for the command-line:

$ echo '1234567' | gumba 'toNumber().numberFormat()'

It's a bit like Awk or sed, but for the chainable text operations supported by CoffeeScript and Underscore.string.


watch-array (GitHub: azer / watch-array, License: BSD, npm: watch-array) by Azer Ko├žulu causes arrays to emit events when mutator methods are used. Usage is simple -- just call watchArray on an array, and pass it a callback that will be triggered when the array changes:

var watchArray = require('watch-array');
var people = ['Joe', 'Smith'];

watchArray(people, function(update) {
  // => { 1: Taylor, 2: Brown }

  // => [0]

people.push('Taylor', 'Brown');

In a way this is like a micro version of what data binding frameworks implement. The author has included tests written with his fox test framework.