This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kue = require('kue') | |
, jobs = kue.createQueue(); | |
var sequence = 0; | |
setInterval( | |
function () { | |
sequence += 1; | |
(function(sequence) { | |
var job = jobs.create('email', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kue = require('kue') | |
, jobs = kue.createQueue(); | |
var sequence = 0; | |
setInterval( | |
function () { | |
sequence += 1; | |
(function(sequence) { | |
var job = jobs.create('email', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'), | |
array1 = [1, 2, 3], | |
array2 = ['stuff'], | |
cheerio = ['cheerio'], | |
httprequest = require('request'); | |
async.reduce(array1, array2, function (array2, item, callback) { | |
console.log("I've iterated " + item + "x"); | |
callback (array2.push( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'), | |
array1 = [1, 2, 3], | |
array2 = ['stuff'], | |
httprequest = require('request'); | |
async.reduce(array1, array2, function (array2, item, callback) { | |
console.log("I've iterated " + item + "x"); | |
process.nextTick( | |
function () {callback (array2.push( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var httprequest = require('request'), | |
cheerio = require('cheerio'), | |
async = require('async'), | |
array = []; | |
httprequest("http://google.com", function (error, response, body) { | |
var $ = cheerio.load(body); | |
var count = 0; | |
async.waterfall([function (callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var req = require('request'), | |
cheerio = require('cheerio'), | |
async = require('async'), | |
array = []; | |
req('http://dummy.com', function (error, response, body) { | |
var $ = cheerio.load(body); | |
$('strong').each(function(i, item) { | |
array.push($(this).text()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async') | |
var final_array = []; | |
function a(param) { | |
return function() { | |
param * 10; | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async') | |
var final_array = []; | |
function a(param) { | |
console.log("a"); | |
return function() { | |
param * 10; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async') | |
var final_array = []; | |
function a(param) { | |
console.log("a"); | |
return param * 10; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
function one(cb) { | |
console.log("one"); | |
cb(); | |
} | |
function two(cb) { | |
function three(callback){ | |
var a = []; |
NewerOlder