Skip to content

Instantly share code, notes, and snippets.

Tom Chapman chappy84

  • UK
Block or report user

Report or block chappy84

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
chappy84 / mongod
Created Dec 28, 2012
Default install of MongoDB 2.2.2 installed from source running in systemd on Fedora 15
View mongod
OPTIONS="--quiet -f /etc/mongod.conf"
chappy84 /
Last active Feb 13, 2018
Install the native kernel on a CentOS 6 and Newer Linode
### Starting from a fresh CentOS 6 or newer Linode
### Enable the native kernel to boot from pvgrub
### It will autoconfigure itself with each yum update.
### This is adapted from a previous script for CentOS 5.5 found here:
### Provided via the linode wiki
### Provided without warranty, although since it should only be run
### on first box build if your box gets broken simply rebuild it
chappy84 / tidy-directory.php
Created May 20, 2012
Convert all X/HTML files in a folder to valid X/HTML using libtidy via PHP
View tidy-directory.php
defined('TIDYDIR_EXTENSION') || define('TIDYDIR_EXTENSION', 'html');
function tidyDir($directory) {
$htmlFiles = glob($directory.DIRECTORY_SEPARATOR.'*.'.TIDYDIR_EXTENSION);
$filenameRegEx = '#^(.+?)\.([^\.]+?)$#';
$htmlTidy = new tidy();
foreach ($htmlFiles as $entry) {
if (preg_match($filenameRegEx, $entry, $matches)) {
$filename = $matches[1];
$extension = $matches[2];
chappy84 / HTML5.localStorage.js
Last active Dec 31, 2017
HTML5 Storage without the restrictions on storing objects
View HTML5.localStorage.js
if (typeof HTML5 == 'undefined') {
var HTML5 = {};
* Wrapper class to deal with easily storing values in local storage
* without having to constantly use JSON.parse and JSON.stringify everywhere
* you want to save an object.
* @param {String} index the base index to use in the localStorage global object
* @author Tom Chapman
You can’t perform that action at this time.