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
/** | |
* See docs for path resolution... | |
* http://nodejs.org/docs/v0.4.12/api/modules.html | |
*/ | |
var foo = require('./foo'); | |
console.log(foo.bar()); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="tweets"></div> | |
<!-- | |
Since we bound the socket.io library to our web server, it will know about this file. | |
--> |
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 utils = require('cluster/lib/utils') | |
, store = {}; | |
module.exports = function (options) { | |
options = options || {}; | |
ratelimit.enableInWorker = true; | |
function ratelimit (master) { | |
var server = master.server; | |
utils.unshiftListener(server, 'connection', function (sock) { | |
sock.pause(); |
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 micro = require('./lib/micro'); | |
micro.get('/json', function(req, res) { | |
res.json({ | |
a: 1 | |
, b: '2' | |
}); | |
}); | |
micro.get('/text', function(req, res) { |
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
> [email protected] preinstall /usr/share/www/analytics-engine.com/application/node_modules/vbench/node_modules/canvas | |
> node-waf configure build | |
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for node path : not found | |
Checking for node prefix : ok /usr/local |
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 utils = require('cluster/lib/utils'); | |
var redis = require('redis'); | |
var rc = redis.createClient(); | |
exports = module.exports = function(options) { | |
ratelimit.enableInWorker = true; | |
options = options || {}; | |
var interval = options.interval = (options.interval || 1); |
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 tree = { | |
id: null, | |
children: [ | |
{ | |
id: null, | |
children: [ | |
{ | |
id: null, | |
children:[ | |
{ |
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
<a href="#/hello">hello</a> | |
<br/> | |
<a href="#/bye">bye</a> | |
<script> | |
route | |
(/^\/hello$/, function(){ alert('hello ran'); }) | |
(/^\/bye$/, function(){ alert('bye ran'); }) | |
; | |
</script> |
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
window.StopWatch = (function() { | |
var seconds = 0; | |
var minutes = 0; | |
var timer = null; | |
var events = { | |
second: [], |
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 http = require('http'); | |
http.createServer(function(req, res) { | |
var url = req.url; | |
switch (url) { | |
case '/engagement.js': | |
var timer = setTimeout(function() { | |
clearTimeout(timer); | |
console.log('client is still here after two seconds.'); |