Backbone.js Screencasts, XDate, JavaScript BigInteger Library

2011-10-24 15:00

Backbone.js Screencasts, XDate, JavaScript BigInteger Library

by

at 2011-10-24 07:00:00

original http://feedproxy.google.com/~r/dailyjs/~3/ZmYZABi22ac/backbone-screencasts-xdate-biginteger

Backbone.js Screencasts

Backbone.js Screencasts is a commercial set of Backbone.js tutorials from 30 Cubits that costs $9 (until November 9th, then $18 thereafter) for 106 minutes of videos. The videos cover the core Backbone.js functionality like views, routers, events, models, collections, and also how to use other JavaScript techniques alongside your Backbone.js code.

There’s a preview of the content on Vimeo here: Backbone.js Quickly – Preview.

XDate

XDate (GitHub: arshaw / xdate, License: dual MIT and GPL) by Adam Shaw is a wrapper around Date that provides improved date parsing, formatting, and manipulation. XDate format strings really help with formatting dates, which I find myself doing a lot lately in Node or single page applications.

Here’s an example of XDate’s formatting method:

new XDate(2011, 0, 1, 6, 0).toString('d/M/yy h(:mm)TT');

Another useful feature of this library is the set of XDate diffing methods. They provide a friendly API around date subtraction.

Most of XDate’s methods return an XDate, so it’s chainable too:

d1 = new XDate();
d2 = d1.clone()
       .setUTCMode(true)
       .setDate(1)
       .addMonths(1)
       .addYears(2);

JavaScript BigInteger Library

The JavaScript BigInteger Library (GitHub: silentmatt / javascript-biginteger, License: MIT) by Matthew Crumley is a BigInteger library for JavaScript. The author has written detailed blog posts on how the library works and the algorithms behind it:

If you look at the source, you’ll probably notice that I’m actually using base 10000000, not base 10. I’m using decimal in these examples because it makes things clearer but everything works pretty much exactly the same way in any base. Using a larger base just makes things more efficient because you get 7 digits in each array entry.

Matthew created this library to support his Google Chrome Scientific Calculator.