Skip to content

Instantly share code, notes, and snippets.

<?php
namespace common\components\pgsql;
use yii\base\Behavior;
use yii\db\ActiveRecord;
class ArrayBehavior extends Behavior
{
public $attributes;
@bel1k0v
bel1k0v / d3-tree-sort.js
Last active February 16, 2016 21:07
max-children-sort
function getMaxDepth(node) {
var max;
if (node.children) {
var c = node.children.length;
max = node.children[0].depth;
for (var i = 0; i < c; ++i) {
max = getMaxDepth(node.children[i]);
}
} else {
max = node.depth;