Skip to content

Instantly share code, notes, and snippets.

<body xmlns="http://jabber.org/protocol/httpbind"
sid="e0408bf8d86f0a7f44afda59aa8f81b75d029bb6"
wait="60"
requests="2"
inactivity="30"
maxpause="120"
polling="2"
ver="1.6"
from="ymc-pg-ejabberd"
secure="true"

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

var spawn = require('child_process').spawn,
sys = require('sys');
function createSSH(passphrase, path, name) {
var ssh = spawn('ssh-keygen', ['-trsa', '-N \''+ passphrase +'\'', '-f ' + name], { cwd:path, env: process.env, customFds: [-1, -1, -1]})
ssh.on('exit', function (code, signal) {
process.exit();
});

使用closure表在MySQL中管理分层关系

创建表

创建一个表示所有树节点的表.

CREATE TABLE `tree_node` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `data_body` text,

node_deleted datetime DEFAULT NULL,