Skip to content

Instantly share code, notes, and snippets.

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
<?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
CrandellWS /
Created April 30, 2016 17:14 — forked from hamakn/
Android: Get height of status, action, navigation bar (pixels)
// 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(
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 /
Created May 29, 2016 17:24
Alert Dialog Cancel Activity to send onResume event.
import android.os.Bundle;
* Created by William on 5/29/2016.
* new AlertDialog.Builder(this).
* use:(OnClickListener){setNegativeButton, setNeutralButton, setPositiveButton}
CrandellWS / .travis.yml
Created September 23, 2016 20:47 — forked from mariotaku/.travis.yml
Sign and upload compiled apk to Github releases automatically using Travis CI
language: android
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-22.0.0
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
position: relative;
color: rgba(255,255,255,1);
text-decoration: none;