Skip to content

Instantly share code, notes, and snippets.

@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',
@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 / 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 / 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;

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.diff
Created April 17, 2014 17:21
diff between PodsAPI.php (Pods 2.4) and my patched version (from Pods 2.3.12, with commit e7fbf4dcf8b928adbf88604ae7ee1dee63679e37 removed altogether)
--- classes/PodsAPI.php 2014-04-17 17:53:31.474513029 +0100
+++ /tmp/PodsAPI.php 2014-04-17 18:01:09.000000000 +0100
@@ -106,13 +106,12 @@
* @param array $meta (optional) Associative array of meta keys and values
* @param bool $strict (optional) Decides whether the previous saved meta should be deleted or not
* @param bool $sanitized (optional) Will unsanitize the data, should be passed if the data is sanitized before sending.
- * @param array $fields (optional) The array of fields and their options, for further processing with
*
* @return bool|mixed
*
@hotzeplotz
hotzeplotz / full_profile_with_patched_PodsAPI.log
Last active August 29, 2015 14:00
profiling log for code using Pods - tracking slowdown issue which started with Pods 2.3.10
[28-Apr-2014 04:52:28 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2012/includes/pods/pods/article/pods-article.php : 7 : '0.12187500 1398660748'
[28-Apr-2014 04:52:30 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2012/includes/pods/pods/article/pods-article.php : 20 : '0.43714600 1398660750'
[28-Apr-2014 04:52:30 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2012/includes/pods/pods/article/pods-article.php : 29 : '0.44079700 1398660750'
[28-Apr-2014 04:52:30 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2012/includes/pods/pods/article/pods-article.php : 36 : '0.44684500 1398660750'
[28-Apr-2014 04:52:30 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2012/includes/pods/pods/article/pods-article.php : 42 : '0.44755500 1398660750'
[28-Apr-2014 04:52:39 UTC] tracing timestamp: /srv/web/wordpress/www/htdocs/wp-content/themes/lsecities-2
@hotzeplotz
hotzeplotz / index.html
Last active August 29, 2015 14:03 — forked from anonymous/index.html
<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Scroll</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
Metro vs City population
### Keybase proof
I hereby claim:
* I am hotzeplotz on github.
* I am hotzeplotz (https://keybase.io/hotzeplotz) on keybase.
* I have a public key whose fingerprint is F181 C0CD 9D04 F3CE EBC1 B3E2 0C9D 57B1 AD6D E667
To claim this, I am signing this object: