Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
😎

Alex van den Hoogen alex3305

💭
😎
  • Geodan
  • Tilburg, Netherlands
View GitHub Profile
@alex3305
alex3305 / InputValidationFunction.java
Last active Aug 29, 2015
Java 8 simple input validation with quotes
View InputValidationFunction.java
/**
* Function that checks whether the command line input is valid. This
* method can handle input with spaces that are escaped inside
* quotation marks (either " or '). However this method will throw
* an Exception when either the input is empty or when the input
* is malformed.
*
* Malformed input occurs when there are an odd number of quotation
* marks in the input string, but only if there are more than one.
*
@alex3305
alex3305 / index.php
Last active Nov 12, 2019
HTML to PDF converter with marginless cover page with Snappy and PDF Merge
View index.php
<?php
/**
* PDF exporter for Mediawiki. This will load a specified content page and
* will append a seperate, specified cover page to the returning document.
*
* Requirements:
* - PHP 5.1+
* - wkhtmltox (wkhtmltopdf) 0.12+ (http://www.wkhtmltopdf.org)
* - KnpLabs Snappy (https://github.com/KnpLabs/snappy/)
* - PDF Merger for PHP (http://pdfmerger.codeplex.com/)