background preloader

Node.js

Facebook Twitter

Cube. Time Series Data Collection & Analysis Cube is a system for collecting timestamped events and deriving metrics. By collecting events rather than metrics, Cube lets you compute aggregate statistics post hoc. It also enables richer analysis, such as quantiles and histograms of arbitrary event sets. Cube is built on MongoDB and available under the Apache License on GitHub. Collecting Data An event in Cube is simply a JSON object with a type, time, and arbitrary data. Cube’s collector receives events and saves them to MongoDB. Querying Events Cube defines a simple language for querying events. You can intersect filters and customize which event fields are returned. Request(browser).gt(duration, 250).lt(duration, 500) Cube supports both HTTP GET and WebSockets for retrieving events. Querying Metrics You can also use Cube to group events by time, map to derived values, and reduce to aggregate metrics. The first few results of which appear as: sum(request.eq(path, "/search")) sum(request(duration))

Addyosmani/backbone-fundamentals - GitHub. Tbranyen/backbone-boilerplate - GitHub. Jed | Gettext Style i18n for Modern JavaScript Apps. Gettext Style i18n for Modern JavaScript Apps Gettext? Gettext is an old translation standard. It solves a unique set of problems when dealing with things like pluralization and positional interpolation. There are implementations of gettext in nearly every language (including javascript). Safety and Speed Jed parses plural forms using a grammar instead of running eval.

You can find a fairly comprehensive list of plural forms here: translate.sourceforge.net/wiki/l10n/pluralforms Sane API Wrappers Sometimes using gettext directly is fine, but knowing which gettext function to call at runtime can often be cumbersome. Jed API The core available functions on an instantiated Jed object are: Jed also exposes all the standard Gettext functions on an instance. Now that you have an instance that's attached to a set of locale data, and often a default domain, you'll want to pull out translations Installation Node npm install jed Then in your app: var Jed = require('jed'); Webpage ( global ) AMD Module Details. Brianchirls/Seriously.js at develop - GitHub. RailwayJS. Validations invoked after create, save and updateAttributes, it also possible to skip validations when use save method: Validations can be called manually using isValid method of object Normally all validations result in errors member of object, which is a hash of arrays of error messages: It also can raise exception, if you want, just pass throws: true as param of save method: To setup validation, call it configurator on class: Each configurator accepts set of string arguments, and one optional last argument, which is actually specify how validator should work, of course it depends on each validator, but there's few common options: ifunlessmessageallowNullallowBlank if and unless methods is for skipping validations depending on conditions, it can be function, or string.

Message member allows to configure error message, it can be string or object (depends on validator), see usage examples allowNull and allowBlank is self explanatory :) Examples of different types of validations: length inclusion. NodeCloud - Node.js resources.