Skip to content

Instantly share code, notes, and snippets.

View benryersonsnippets's full-sized avatar

benryersonsnippets

View GitHub Profile
@benryersonsnippets
benryersonsnippets / image_ptag_remover.php
Created May 10, 2012 12:52
WP: WordPress Image P tag remover plugin
<?php
/*
Plugin Name: Image P tag remover
Description: Plugin to remove p tags from around images and iframes in content outputting, after WP autop filter has added them. (oh the irony)
Version: 1.1
Author: Fublo Ltd
Author URI: http://blog.fublo.net/2011/05/wordpress-p-tag-removal/
*/
function filter_ptags_on_images($content)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
<script src=""></script>
@benryersonsnippets
benryersonsnippets / gist:2485228
Created April 25, 2012 01:24 — forked from paulirish/gist:366184
JS: HTML5 geolocation with fallback
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;
@benryersonsnippets
benryersonsnippets / gist:2485110
Created April 25, 2012 01:01 — forked from padolsey/gist:527683
JS: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}