Skip to content

Instantly share code, notes, and snippets.


Andy Jackson anjackson

View GitHub Profile
anjackson /
Created Jan 19, 2012
Embedding a JavaFX WebView in a Swing panel.
import com.sun.javafx.application.PlatformImpl;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
import javafx.scene.Node;
anjackson / gist:2888380
Created Jun 7, 2012
Making a Bottle app that routes to a proxy
View gist:2888380
import bottle
from import WSGIProxyApp
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13)
# since they are not allowed by the WSGI standard.
anjackson / PDF Encryption test for .net
Created Mar 25, 2013
This shows the logic needed to test for two the different PDF encryption modes. It is written in C#, and has been tested with version 1.2.1 of PDFBox, cross-compiled to .net using IKVM (
View PDF Encryption test for .net
Console.WriteLine("Document encrypted = {0}", document.isEncrypted().ToString());
// Can it be opened?
bool isOpenable = true;
if (document.isEncrypted())
DecryptionMaterial decryptionMaterial = new StandardDecryptionMaterial("");
AccessPermission ap = document.getCurrentAccessPermission();
View console.log
09:14:40.487 GET [HTTP/1.1 304 Not Modified 190ms]
09:14:40.684 Error in parsing value for 'image-rendering'. Declaration dropped. messloader.html:10
09:14:40.684 Error in parsing value for 'image-rendering'. Declaration dropped. messloader.html:11
09:14:40.684 Error in parsing value for 'image-rendering'. Declaration dropped. messloader.html:12
09:14:40.684 Unknown pseudo-class or pseudo-element '-webkit-full-screen'. Ruleset ignored due to bad selector. messloader.html:20
09:14:41.048 GET [HTTP/1.1 404 Not Found 93ms]
09:14:41.049 GET [HTTP/1.1 404 Not Found 185ms]
09:14:40.845 NS_ERROR_NOT_AVAILABLE: jsmess-loader.js:41
09:14:41.189 SyntaxError: illegal character messloader.html
anjackson / cvs2git.options
Created Mar 11, 2014
Scripts and config for moving JHOVE from SourceForge CVS to GitHub
View cvs2git.options
# (Be in -*- mode: python; coding: utf-8 -*- mode.)
# ====================================================================
# Copyright (c) 2006-2010 CollabNet. All rights reserved.
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
anjackson / DROID application.msword generators
Created Mar 17, 2014
Comparison of software generator results
View DROID application.msword generators
View gist:0a37aa989011e8f2d10e
anjackson / drupal-authentication.php
Created Aug 20, 2014
Script to bootstrap and authenticate against Drupal, for Apache mod_auth_external.
View drupal-authentication.php
# Globals to hold status:
$drupal_bootstrapped = FALSE;
$authenticated = FALSE;
# Use a shutdown function to ensure that authentication does not go through
# if bootstrapping Drupal fails (because PHP's die() returns exit(0)):
function shutdown() {
anjackson / sample3.wav.jhove2.log
Created Aug 21, 2014
jhove2 src/test/resources/wave/sample3.wav | grep -v "TypeConverterDelegate" > sample3.wav.jhove2.log
View sample3.wav.jhove2.log
StartingOffset (byte): 0
EndingOffset (byte): 95
Size (byte): 96
Path: /Users/andy/Documents/workspace/jhove/src/test/resources/wave/sample3.wav
LastModified: 2014-08-21T10:20:13+01:00
PresumptiveFormat {FormatIdentification}:
NativeIdentifier {I8R}:
View gist:e2e22bd847b14517e5b0
$ tika -m ~/Downloads/Sample\ 10.x.pdf
Content-Length: 5994
Content-Type: application/pdf
Creation-Date: 2014-03-04T20:56:45Z
Last-Modified: 2014-03-04T21:14:56Z
Last-Save-Date: 2014-03-04T21:14:56Z
X-Parsed-By: org.apache.tika.parser.DefaultParser
X-Parsed-By: org.apache.tika.parser.pdf.PDFParser
created: Tue Mar 04 20:56:45 GMT 2014
date: 2014-03-04T21:14:56Z