Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
| var domain = require('domain'); | |
| var d = domain.create() | |
| var fs = require('fs') | |
| server = require('http').createServer( | |
| function(req, res) { | |
| var d2 = domain.create(); | |
| d2.add(req) | |
| d2.add(res) |
| var arDrone = require('ar-drone'); | |
| var client = arDrone.createClient(); | |
| client.takeoff(); | |
| client | |
| .after(5000, function() { | |
| this.clockwise(0.5); | |
| }) | |
| .after(3000, function() { |
| var zlib = require('zlib'); | |
| var completed = 0; | |
| function printProcMem() { | |
| if (completed % 100 == 0) { | |
| var mem = process.memoryUsage(); | |
| console.log('%d %d %d %d', | |
| completed, mem.rss / 1000000, mem.heapTotal / 1000000, mem.heapUsed / 1000000); | |
| } |
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
});| function runSpecs() { | |
| // configure the spec runner | |
| var specRunner = new Hilo.SpecRunner({ | |
| src: "Hilo", | |
| specs: "specs", | |
| helpers: "specs/Helpers" | |
| }); | |
| // Handle any errors in the execution that | |
| // were not part of a failing test |
| MyView = Backbone.View.extend({ | |
| events: { | |
| "click #someButton": "doThat", | |
| "change #someInput": "changeIt" | |
| }, | |
| doThat: function(){ ... }, | |
| changeIt: function(){ ... } | |
| }); |
| for (var i = 0; i < 1024 * 1024; i++) { | |
| process.nextTick(function () { Math.sqrt(i) } ) | |
| } |