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
/*jslint node: true, maxerr: 50, indent: 4 */ | |
"use strict"; | |
var clusterInstance; | |
var SimpleCluster = module.exports = function () { | |
//there should only be one instance of this per process | |
if (clusterInstance) { | |
return clusterInstance; |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'xmpp4r-simple' | |
jabber = Jabber::Simple.new("[email protected]", "password_of_weibo") | |
#at_exit{jabber.status(:away, "jabot down")} | |
EM.run do | |
EM::PeriodicTimer.new(1) do | |
jabber.received_messages do |message| | |
case message.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
/** | |
* Tell the client to display a prompt dialog to the user. | |
* If the client returns true, WebView will assume that the client will | |
* handle the prompt dialog and call the appropriate JsPromptResult method. | |
* | |
* Since we are hacking prompts for our own purposes, we should not be using them for | |
* this purpose, perhaps we should hack console.log to do this instead! | |
* | |
* @param view | |
* @param url |
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
/* | |
This library was developed by Will Honey. | |
It is licensed under the GPLv3 Open Source License | |
This library requires the underscore library found at http://documentcloud.github.com/underscore/ | |
This library requires the underscore string library found at http://edtsech.github.com/underscore.string/ | |
This library requires the support of localStorage. Updates could be easily made to change that. | |
*/ | |
/* jslint adsafe: false, devel: true, regexp: true, browser: true, vars: true, nomen: true, maxerr: 50, indent: 4 */ |
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
(function(module) { | |
var http = require('http'); | |
module.exports = function (request, response, serverHost, serverPort) { | |
response.header('X-Proxyed-By' ,'Weibo-Packager'); | |
serverPort = serverPort || 80; | |
var proxyRequest = http.request({ | |
host : serverHost || request.headers.host, | |
port : serverPort, | |
path : request.url, | |
method : request.method, |
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
(function() { | |
var path = require('path'), fs = require('fs'); | |
function walk(uri,filter,tree) { | |
var node = { | |
name : null, | |
children : [], | |
pNode : null, | |
}; | |
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'), exec = require('child_process').exec; | |
var app = express.createServer(); | |
app.use(app.router); | |
app.get('/ls', function(req, res) { | |
exec('ls . ', function(error, stdout, stderr) { | |
console.log(stdout); | |
res.write(stdout, 'utf-8'); | |
res.write(stderr, 'utf-8'); | |
if(error) { |
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
require 'rubygems' | |
require 'sinatra' | |
require 'eventmachine' | |
get '/evented' do | |
stream(:keep_open) do |out| | |
EventMachine::PeriodicTimer.new(1) { out << "#{Time.now}\n" } | |
end | |
end |
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'), spawn = require('child_process').spawn; | |
var app = express.createServer(); | |
app.use(app.router); | |
var tail; | |
app.get('/tail', function(req, res) { | |
res.header('Content-Type','text/html;charset=utf-8'); | |
tail = spawn('tail', ['-f', './test.log']); |