Skip to content

Instantly share code, notes, and snippets.

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@hotzeplotz
hotzeplotz / PodsAPI.php
Created October 27, 2013 13:39
PodsAPI.php as currently working on an otherwise plain Pods 2.3.12 checkout, with commit pods-framework/pods@e64c9b3 removed altogether.
<?php
/**
* @package Pods
*/
class PodsAPI {
/**
* @var PodsAPI
*/
static $instance = null;
@hotzeplotz
hotzeplotz / index.html
Last active December 12, 2015 09:19 — forked from tomhaymore/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Node-Link Tree</title>
<link href="interactive_tree.css" rel="stylesheet" type="text/css" />
<script src="//d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="//d3js.org/d3.layout.js"></script>
@hotzeplotz
hotzeplotz / hide-editor.js
Created August 21, 2012 10:07
Hide WordPress editor box while editing a page if a specific template is selected
jQuery(document).ready(function($) {
var editorElement = '#postdivrich';
var podsPrefix = /^pods-/;
function hideElementIfUnused(element, match, val) {
if(match.test(val)) {
$(element).hide();
} else {
$(element).show();
}
@hotzeplotz
hotzeplotz / gist:3169751
Created July 24, 2012 12:45
attach Google Analytics event tracking to all PDFs on a page
// jQuery regex filter (http://james.padolsey.com/javascript/regex-selector-for-jquery/)
jQuery.expr[':'].regex = function(elem, index, match) {
var matchParams = match[3].split(','),
validLabels = /^(data|css):/,
attr = {
method: matchParams[0].match(validLabels) ?
matchParams[0].split(':')[0] : 'attr',
property: matchParams.shift().replace(validLabels,'')
},
regexFlags = 'ig',