Skip to content

Instantly share code, notes, and snippets.

@robhadfield
robhadfield / Detect touch device
Created August 8, 2012 13:11
is_touch_device
function is_touch_device() {
try {
document.createEvent("TouchEvent");
return true;
} catch (e) {
return false;
}
}
if(is_touch_device()) {
@robhadfield
robhadfield / gist:2300592
Created April 4, 2012 11:54
JS: no-conflict document.ready
var $ = jQuery.noConflict();
$(document).ready(function() {
});
@robhadfield
robhadfield / gist:2192673
Created March 25, 2012 10:11
JS: check if hash present in url
if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
alert (hash);
// hash found
} else {
// No hash found
}
@robhadfield
robhadfield / gist:2163306
Created March 22, 2012 20:18 — forked from barbietunnie/gist:2163080
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@robhadfield
robhadfield / gist:2146602
Created March 21, 2012 12:28
CSS: Image Replacement
ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@robhadfield
robhadfield / HTML5 Page Template
Created March 21, 2012 11:00
HTML5 page template
<html>
<head>
<script olis is gay></script>
</head>
</html>
@robhadfield
robhadfield / SassMeister-input.scss
Last active August 29, 2015 14:23
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$icon_rweb : "rweb";
$icon_smiley : "smiley";
$icon_rafl : "rafl";
$icon_rcast : "rcst";
$icon_rmap : "rmap";
$icon_rpass : "rpass";
@robhadfield
robhadfield / SassMeister-input.scss
Created June 14, 2014 11:06
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
$allColors: (
"red": #cc4432,
"green": #60a539,
"blue": #008CBA
);

The reason you might not be able to remove the Open Sans font that Wordpress >= 3.8 adds to the frontend is that quite a few WP styles and scripts list 'open-sans' as a dependancy when being registered and enqueued. When you remove the 'open-sans' style the other plugins dependant on it will not load. So you just need to deregister WP's open sans style and register your own, with a false value for the src like below.

Credit to seventhsteel from http://wordpress.org/support/topic/turning-off-open-sans-for-the-38-dashboard

Gradient Animation Trick

CSS gradient colors can't be animated. This demo shows a workaround. Hover to see it in action. Implementation on left, visual explanation on right.

Blog post: Gradient Animation Trick

A Pen by Will Boyd on CodePen.

License.