Skip to content

Instantly share code, notes, and snippets.

Pierre Ernst pierre-ernst

  • Ottawa ON, Canada
Block or report user

Report or block pierre-ernst

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
@pierre-ernst
pierre-ernst / YarnLock2Dot.java
Created Oct 31, 2019
Builds a DOT-notation dependency graph from a yarn.lock file. Can be used to produce SVG or PNG images. $ sfdp -Gsize=50! -Goverlap=prism -Tsvg tree.dot > tree.svg
View YarnLock2Dot.java
package com.github.pierre_ernst;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.*;
@pierre-ernst
pierre-ernst / Odc2mvn.java
Last active Oct 16, 2019
Converts an OWASP DependencyCheck XML output to a Maven pom.xml
View Odc2mvn.java
package com.github.pierre_ernst;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import java.io.File;
@pierre-ernst
pierre-ernst / FinalizeTester.java
Created Apr 7, 2016
Testing if the finalize() method is called for objects created by deserialization
View FinalizeTester.java
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URL;
import java.net.HttpURLConnection;
You can’t perform that action at this time.