Skip to content

Instantly share code, notes, and snippets.

William Crandell CrandellWS

Block or report user

Report or block CrandellWS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dbinfo.php
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
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>";
die();
$DB_HOST = $_POST['dbhost'];
$DB_DATABASE = $_POST['dbname'];
$DB_USERNAME = $_POST['dbuser'];
@CrandellWS
CrandellWS / README.md
Created Sep 25, 2015 — forked from mbostock/.block
Cluster Dendrogram
View README.md

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
CrandellWS / README.md
Last active Sep 29, 2015 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.
View README.md

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
CrandellWS / README.md
Last active Oct 17, 2015 — forked from mbostock/.block
Contractor.Support Collapsible Tree
View styles.xml
<?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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@CrandellWS
CrandellWS / height.java
Created Apr 30, 2016 — forked from hamakn/height.java
Android: Get height of status, action, navigation bar (pixels)
View height.java
// status bar height
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
// action bar height
int actionBarHeight = 0;
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes(
View NoExtraDigits-UsPhoneNumberFormatter.java
private class UsPhoneNumberFormatter implements TextWatcher {
//This TextWatcher sub-class formats entered numbers as 1 (123) 456-7890
private boolean mFormatting; // this is a flag which prevents the
// stack(onTextChanged)
private boolean clearFlag;
private int mLastStartLocation;
private String mLastBeforeText;
private WeakReference<EditText> mWeakEditText;
@CrandellWS
CrandellWS / DismissCancelDialogActivity.java
Created May 29, 2016
Alert Dialog Cancel Activity to send onResume event.
View DismissCancelDialogActivity.java
import android.app.Activity;
import android.os.Bundle;
/**
* Created by William on 5/29/2016.
*
* new AlertDialog.Builder(this).
*
* use:(OnClickListener){setNegativeButton, setNeutralButton, setPositiveButton}
You can’t perform that action at this time.