Skip to content

Instantly share code, notes, and snippets.

@InPermutation
Created May 13, 2013 22:26
Show Gist options
  • Select an option

  • Save InPermutation/5572029 to your computer and use it in GitHub Desktop.

Select an option

Save InPermutation/5572029 to your computer and use it in GitHub Desktop.
gravatar.com URL resizing on DPI change (this is stupid)
setInterval(function(){
if(window.devicePixelRatio > 1) {
jQuery('img.profilePic').each(function(){
var el=this;
if(!el.src.contains('gravatar.com')) return;
el.src = el.src.replace(/\bs=(\d+)/,
function(match, px) {
return "s="+Math.round(window.devicePixelRatio*jQuery(el).innerWidth());
});
});
}
}, 250);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment