Skip to content

Instantly share code, notes, and snippets.

View lucagrulla's full-sized avatar

Luca Grulla lucagrulla

View GitHub Profile
@lucagrulla
lucagrulla / gist:1240766
Created September 25, 2011 16:07
Marks-solution
// for the origina blog post check
// http://www.markhneedham.com/blog/2011/09/25/jquery-collecting-the-results-from-a-collection-of-asynchronous-requests/
var people = ["Marc", "Liz", "Ken", "Duncan", "Uday", "Mark", "Charles"];
asyncLoop(people, [], function(name, grid, callBackFn) {
// parse data and create something cool
grid.push(somethingCool);
callBackFn();
}, function(grid) {
// do something with grid
@lucagrulla
lucagrulla / gist:1240760
Created September 25, 2011 16:03
Mark-initial-problem
//for the original blog post check
//http://www.markhneedham.com/blog/2011/09/25/jquery-collecting-the-results-from-a-collection-of-asynchronous-requests/
var people = ["Marc", "Liz", "Ken", "Duncan", "Uday", "Mark", "Charles"];
var grid = [];
$.each(people, function(index, person) {
$.getJSON('/git/pairs/' + person, function(data) {
// parse data and create somethingCool
grid.push(somethingCool);
@lucagrulla
lucagrulla / gist:1212271
Created September 12, 2011 20:16
node-tail example
Tail = require('tail').Tail;
tail = new Tail("fileToTail");
tail.on("line", function(data) {
console.log(data);
});