Skip to content

Instantly share code, notes, and snippets.

View glennblock's full-sized avatar

Glenn Block glennblock

View GitHub Profile
@glennblock
glennblock / gist:3020182
Created June 29, 2012 19:40
output version
var http = require('http');
http.createServer(function(req,res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello from Windows Azure running node version: ' + process.version + '</br>');
}).listen(process.env.PORT || 3000);
azure site create node081test --git
curl -O http://nodejs.org/dist/v0.8.1/node.exe
nodeProcessCommandLine: "D:\home\site\wwwroot\bin\node.exe"
git add .
git commit -m "using node v0.81"
{
"name": "A",
"version": "0.1.0",
"dependencies": {
"B": {
"version": "0.0.1",
"dependencies": {
"C": {
"version": "0.1.0"
}
mssql.queryMultiple(conn_info, "SELECT TOP 5 FirstName,LastName FROM Person.Person SELECT TOP 10 Street, City, State, Zip FROM Address ",
function(results) {
results.foreach(function(result) {
result.on('meta', function(meta) {...});
result.on('row', function(id) {...});
result.on('column', function(column) {...});
result.on('done', function() {...});
result.on('error', function(err) {...});
});
}
@glennblock
glennblock / gist:3297118
Created August 8, 2012 18:05
Create counts for modules by category from nodejs.org module wiki
var request = require('request');
var sax = require('sax');
var parser = sax.parser(false);
var categories=[];
var category;
var FIND_MODULES_START = 0;
var FIND_CATEGORY = 1;
var FIND_CATEGORY_NAME = 2;
var FIND_MODULES = 3;
@glennblock
glennblock / gist:3297366
Created August 8, 2012 18:31
Module counts by category off of the node module wiki
API clients: 118
Boilerplates: 10
Build and deployment: 50
Chat: 1
Class systems: 11
Compression: 16
Content Management Systems: 14
Continuous Integration Tools: 3
Control flow / Async goodies: 78
CSS Engines: 12
var mc = require("mc");
var mcclient = new mc.Client('localhost_WebRole1');
mcclient.connect(function() {
console.log("Connected to the localhost memcache on port 11211!");
});