创建一个表示所有树节点的表.
CREATE TABLE `tree_node` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`data_body` text,
node_deleted
datetime DEFAULT NULL,
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(); | |
}); |
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 "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
<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" |
# How to echobot with XMPP, BOSH, and Strophe | |
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected] | |
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
#/etc/hosts | |
127.0.0.1 localhost.local | |
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
/* global Application, ObjC, $ */ | |
/** | |
* repozish.js | |
* | |
* this is an example of using os x yosemite's "JavaScript for Automation": | |
* | |
* https://developer.apple.com/library/prerelease/mac/releasenotes/interapplicationcommunication/rn-javascriptforautomation/index.html | |
* | |
* it repositions some windows based on some position settings. you can run |
// Load data tiles from an AJAX data source | |
L.TileLayer.Ajax = L.TileLayer.extend({ | |
_requests: [], | |
_addTile: function (tilePoint) { | |
var tile = { datum: null, processed: false }; | |
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile; | |
this._loadTile(tile, tilePoint); | |
}, | |
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile | |
_xhrHandler: function (req, layer, tile, tilePoint) { |
defmodule ROP do | |
defmacro try_catch(args, func) do | |
quote do | |
(fn -> | |
try do | |
unquote(args) |> unquote(func) | |
rescue | |
e -> {:error, e} | |
end |
defmodule ApiBridge do | |
@moduledoc """ | |
Module for rpc call remote api@node functions. | |
""" | |
@defualt_rpc_timeout 3000 | |
@doc """ | |
rpc macro for api call | |
""" | |
defmacro rpc(exp, timeout \\ @defualt_rpc_timeout) do |
import psycopg2 | |
from riak import RiakClient, RiakObject | |
from riak.datatypes import Set | |
import datetime | |
# Riak connection and set | |
client = RiakClient(pb_port=8087) | |
SETS_BUCKET = client.bucket_type('sets').bucket('key_sets') | |
# Get columns for table |