创建一个表示所有树节点的表.
CREATE TABLE `tree_node` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`data_body` text,
node_deleted
datetime DEFAULT NULL,
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
window.WebSocket = window.WebSocket || window.MozWebSocket; | |
var websocket = new WebSocket('ws://127.0.0.1:9000', |
defmodule CommentPath do | |
@moduledoc""" | |
Comment [closure table](http://www.slideshare.net/billkarwin/models-for-hierarchical-data). | |
""" | |
@primary_key false | |
schema "comment_paths" do | |
field :ancestor_id, Ecto.UUID | |
field :descendant_id, Ecto.UUID | |
field :depth, :integer |
%% Author: Alex Radetsky <rad@pearlpbx.com> | |
%% Module: Simple SMPP Server on Erlang, gen_fsm, ranch, smpp34pdu. | |
%% It always authorize bind_transceiver and receives submit_sm | |
-module(smpp_protocol). | |
-behaviour(gen_fsm). | |
-behaviour(ranch_protocol). | |
-include_lib("smpp34pdu/include/smpp34pdu.hrl"). |
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 |
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 |
defmodule ROP do | |
defmacro try_catch(args, func) do | |
quote do | |
(fn -> | |
try do | |
unquote(args) |> unquote(func) | |
rescue | |
e -> {:error, e} | |
end |
// 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) { |
/* 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 |