Skip to content

Instantly share code, notes, and snippets.

@BacktickIO
Forked from niccai/command.js
Last active December 27, 2015 19:19
Show Gist options
  • Save BacktickIO/7376213 to your computer and use it in GitHub Desktop.
Save BacktickIO/7376213 to your computer and use it in GitHub Desktop.
/*
Original by Paul Irish and Modified from
http://www.paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/
*/
(function() {
var i, a, aLength, s;
a = document.getElementsByTagName('link');
aLength = a.length;
for (i=0; i < aLength; i++) {
s = a[i];
if (s.rel.toLowerCase().indexOf('stylesheet') >= 0 && s.href) {
var h = s.href.replace(/(&|\?)forceReload=\d+/,'');
s.href = h + (h.indexOf('?') >= 0 ? '&' : '?') + 'forceReload=' + (new Date().valueOf());
}
}
})();
{
"name": "Refresh CSS",
"description": "Reload just your CSS. Great for iterating quickly in JavaScript heavy applications.",
"link": "http://goo.gl/jjYy1V"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment