Skip to content

Instantly share code, notes, and snippets.

View davidjgraph's full-sized avatar
🏠
Typing...

David Benson davidjgraph

🏠
Typing...
View GitHub Profile
@davidjgraph
davidjgraph / mxCompactTree.js
Created March 5, 2014 11:13
mxCompactTree from mxGraph 2.5.1
/**
* $Id: mxCompactTreeLayout.js,v 1.6 2013/10/28 08:45:05 gaudenz Exp $
* Copyright (c) 2006-2013, JGraph Ltd
*/
/**
* Class: mxCompactTreeLayout
*
* Extends <mxGraphLayout> to implement a compact tree (Moen) algorithm. This
* layout is suitable for graphs that have no cycles (trees). Vertices that are
* not connected to the tree will be ignored by this layout.
@davidjgraph
davidjgraph / dia_it.txt
Created March 6, 2014 16:33
draw.io Italian translations
# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE
aboutDrawio=About draw.io
access_denied=Accesso negato
actualSize=Dimensione attuale
add=Add
addLayer=Add layer
addProperty=Add property
addToExistingDrawing=Aggiungi al disegno esistente
addWaypoint=Add waypoint
align=Allinea
draw.io Online Privacy and Security Policy
------------------------------------------
This is the privacy and security policy of JGraph Ltd (JGraph) for usage of the online draw.io tool. This policy applies to usage of www.draw.io and drive.draw.io. It does not apply to other sites and applications that embed the draw.io application.
We are JGraph Limited, a company registered in England and Wales - No. 04051179. Our registered office is at:
JGraph Ltd
Artisans' House
Queensbridge
@davidjgraph
davidjgraph / ExportServlet.java
Created March 27, 2014 16:25
Old PDF exporter with custom font mapping
protected void writePdf(String fname, int w, int h, Color bg, String xml, HttpServletResponse response) throws DocumentException,
IOException, SAXException, ParserConfigurationException
{
response.setContentType("application/pdf");
if (fname != null)
{
response.setHeader("Content-Disposition", "attachment; filename=\"" + fname + "\"");
}
@davidjgraph
davidjgraph / helloworld.html
Created June 5, 2014 06:24
helloworld.html
<!--
$Id: helloworld.html,v 1.6 2013/10/28 08:44:54 gaudenz Exp $
Copyright (c) 2006-2013, JGraph Ltd
Hello, World! example for mxGraph. This example demonstrates using
a DOM node to create a graph and adding vertices and edges.
-->
<html>
<head>
<title>Hello, World! example for mxGraph</title>
<!--
$Id: radiallayout.html$
Copyright (c) 2006-2014, JGraph Ltd
Hierarchical Layout example for mxGraph. This example demonstrates the
use of the hierarchical and organic layouts. Note that the hierarchical
layout requires another script tag in the head of the page.
-->
<html>
<head>
@davidjgraph
davidjgraph / gist:5b80c4349343aeb37a18
Created October 29, 2014 07:12
google drive october outages
https://www.google.com/appsstatus#hl=en&v=issue&sid=4&iid=b1cb0e38a5a53273c8a2d8c626cd235f
https://www.google.com/appsstatus#hl=en&v=issue&ts=1414018799000&sid=4&iid=1dfba0ee002bf62fdd6ec449bc4519b7
https://www.google.com/appsstatus#hl=en&v=issue&ts=1413413999000&sid=4&iid=12f2355b54d0cd4d792c8874f5abb548
@davidjgraph
davidjgraph / gist:2270096a3e030849e96b
Created November 4, 2014 21:27
Legacy Google licensing code
package com.jgraph.licensing;
import java.io.IOException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
/**
* $Id: mxPidValvesOld.js,v 1.1 2013/09/09 04:54:19 mate Exp $
* Copyright (c) 2006-2013, JGraph Ltd
*/
//**********************************************************************************************************************************************************
//Valve
//**********************************************************************************************************************************************************
/**
* Extends mxShape.
@davidjgraph
davidjgraph / mxCircleLayout.js
Created November 28, 2014 12:52
mxCircleLayout.js
/**
* Copyright (c) 2006-2013, JGraph Ltd
*/
/**
* Class: mxCircleLayout
*
* Extends <mxGraphLayout> to implement a circluar layout for a given radius.
* The vertices do not need to be connected for this layout to work and all
* connections between vertices are not taken into account.
*