Skip to content

Instantly share code, notes, and snippets.

View HeikoMamerow's full-sized avatar

Heiko Mamerow HeikoMamerow

View GitHub Profile
@HeikoMamerow
HeikoMamerow / PhantomCSS-default-test
Last active September 29, 2016 04:35
Template for CSS regression test with Phantomcss over multiple sites
// This is my default template for a test with PhantomCSS
/*
Require and initialise PhantomCSS module
Paths are relative to CasperJs directory
*/
var fs = require( 'fs' );
var path = fs.absolute( fs.workingDirectory + '/phantomcss.js' );
var phantomcss = require( path );
@HeikoMamerow
HeikoMamerow / first-character.js
Created October 31, 2014 12:33
Mark first character of each word
function first_character() {
var str = document.getElementsByClassName("text")
for (var i = 0; i < str.length; i++) {
str[i].innerHTML = str[i].innerHTML.replace(/\b[a-z0-9]/gi, "<span class='first-char'>$&</span>")
}
}
<?php
/**
* Plugin Name: Grunt Sitemap Generator
* Plugin URI: http://www.github.com/lgladdy
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/