Skip to content

Instantly share code, notes, and snippets.

View ScottPolhemus's full-sized avatar

Scott Polhemus ScottPolhemus

View GitHub Profile
@plasticmind
plasticmind / gist:4282236
Created December 14, 2012 02:51
Hash Cache
function my_load_meta() {
$script = '/js/script.js';
wp_enqueue_script( 'my-tools', get_template_directory_uri().$script, null, my_version_hash($script) );
$stylesheet = '/style.css';
wp_enqueue_style( 'my-style', get_template_directory_uri().$stylesheet, null, my_version_hash($stylesheet) );
}
add_action('wp_enqueue_scripts', 'my_load_meta');
// Create a hash of the file and pass it back for caching purposes
function my_version_hash($file) {
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];