This file contains 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'); | |
function getXml(cb){ | |
var host = 'node.geht-ab.net'; | |
var url = '/original.php' | |
var server = http.createClient(80, host); | |
var request = server.request('GET', url, { Host: host }); | |
request.end(); | |
request.on('response', function (response) { | |
response.setEncoding("binary"); | |
var body = ""; |
This file contains 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 express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'); | |
var app = express.createServer( | |
express.logger(), | |
express.bodyDecoder() | |
); |
This file contains 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
# in controller: | |
# @item = JsTemplate.new('item', :renderer => :mustache) | |
# in view: | |
# %[email protected] | |
# rendered: | |
# {{item.user.name}} | |
class JsTemplate | |
def initialize(id, options = {}) | |
parents = options[:parents] || {} |
This file contains 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 natural = require('natural'), | |
TfIdf = natural.TfIdf, | |
tfidf = new TfIdf(); | |
var gramophone = require('gramophone'); | |
var docs = [ | |
'this document is about node programming language.', | |
'this document is about ruby programming language.', | |
'this document is about the ruby programming language and node programming language.', |