Skip to content

Instantly share code, notes, and snippets.

if (isset($_POST['dbhost'])) {
preg_match( '/^((?!-)[a-z0-9-]{1,63}(?<!-)(\.){0,1})+([a-z]{0,9})(?<!\.)((;port=){1}[0-9]{2,6}){0,1}$/i', $_POST['dbhost'], $matches);
echo "<pre>".print_r($matches, true)."</pre>";
$DB_HOST = $_POST['dbhost'];
$DB_DATABASE = $_POST['dbname'];
$DB_USERNAME = $_POST['dbuser'];
CrandellWS /
Created September 25, 2015 14:15 — forked from mbostock/.block
Cluster Dendrogram

A dendrogram is a node-link diagram that places leaf nodes of the tree at the same depth. In this example, the classes (leaf nodes) are aligned on the right edge, with the packages (internal nodes) to the left. Data shows the Flare class hierarchy, courtesy Jeff Heer.

Compare to this radial layout.

CrandellWS /
Last active October 17, 2015 22:53 — forked from mbostock/.block
Contractor.Support Collapsible Tree
CrandellWS /
Last active April 12, 2021 10:39 — forked from robschmuecker/
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

CrandellWS /
Last active March 14, 2019 23:04
Movie Trailer Page example
CrandellWS / AndroidManifest.xml
Created February 10, 2016 18:46
keyboard app
<manifest xmlns:android=""
<service android:name=".SimpleIME"
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2013 Google, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software