Skip to content

Instantly share code, notes, and snippets.

View papanikge's full-sized avatar

George Papanikolaou papanikge

View GitHub Profile
@papanikge
papanikge / command.js
Last active August 29, 2015 13:56 — forked from JoelBesada/README.md
document.ondragstart=function(){return false};dst=function(e){return (p=Math.pow)(p(e.clientX-(rc=e.target.getBoundingClientRect()).left,2)+p(e.clientY-rc.top,2),.5)};$("[href\x2a=imgur]").not($(t="[href$=jpeg],[href$=gif],[href$=png],[href$=jpg]")).each(function(){this.href+='.jpg'});void($(t).not(".EGraw,.click-gadget a,.domain a,.thumbnail").attr({'class':'EGraw',target:'blank'}).each(function(){$(this).append($('<span />').toggle(function(e){$(this).html(' [-]').nextAll().show();return false},function(e){$(this).html(' [+]').nextAll().hide();return false}).click()).append($('<img>').attr({src:this.href,style:'display:block;max-width:780px;height:auto',title:'Drag to resize'}).mousedown(function(e){(t=this).iw=t.width;t.d=dst(e);t.dr=false;e.preventDefault();}).mousemove(function(e){if((t=this).d){t.style.maxWidth=t.style.width=((dst(e))%2At.iw/t.d)+"px";this.dr=true}}).mouseout(f=function(e){this.d=false;if(this.dr)return false}).click(f)).append($('<span />').html('%26#8635;').click(function(e){(i=$(t=th