Skip to content

Instantly share code, notes, and snippets.

@ColinEberhardt
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save ColinEberhardt/c7f684ff77ab8ce66224 to your computer and use it in GitHub Desktop.

Select an option

Save ColinEberhardt/c7f684ff77ab8ce66224 to your computer and use it in GitHub Desktop.
bookmarklet
javascript:var ngStats=function(){var e,t,n,i=0,a=1/0,l=0,o=0,d=1/0,s=0,r=0,c=document.createElement("div");c.id="stats",c.addEventListener("mousedown",function(e){e.preventDefault(),v(++r%252)},!1),c.style.cssText="width:80px;opacity:0.9;cursor:pointer";var p=document.createElement("div");p.id="fps",p.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:%23002",c.appendChild(p);var h=document.createElement("div");h.id="fpsText",h.style.cssText="color:%230ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",h.innerHTML="W",p.appendChild(h);var m=document.createElement("div");for(m.id="fpsGraph",m.style.cssText="position:relative;width:74px;height:30px;background-color:%230ff",p.appendChild(m);m.children.length<74;){var f=document.createElement("span");f.style.cssText="width:1px;height:30px;float:left;background-color:%23113",m.appendChild(f)}var x=document.createElement("div");x.id="ms",x.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:%23020;display:none",c.appendChild(x);var u=document.createElement("div");u.id="msText",u.style.cssText="color:%230f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",u.innerHTML="D",x.appendChild(u);var g=document.createElement("div");for(g.id="msGraph",g.style.cssText="position:relative;width:74px;height:30px;background-color:%230f0",x.appendChild(g);g.children.length<74;){var f=document.createElement("span");f.style.cssText="width:1px;height:30px;float:left;background-color:%23131",g.appendChild(f)}var v=function(e){switch(r=e){case 0:p.style.display="block",x.style.display="none";break;case 1:p.style.display="none",x.style.display="block"}},y=function(e,t){var n=e.appendChild(e.firstChild);n.style.height=t+"px"},E=function(e){var t,n=e,i=0;do if(i+=n.$$watchers%3Fn.$$watchers.length:0,!(t=n.$$childHead||n!==e%26%26n.$$nextSibling))for(;n!==e%26%26!(t=n.$$nextSibling);)n=n.$parent;while(n=t);return i},b=function(e,t,n){return Math.max(e,Math.min(t,n))};return{REVISION:1,domElement:c,setMode:v,attach:function(r,c,p){var f=angular.element(r||document).scope(),x=f.$digest;f.$digest=function(){return e=Date.now(),t=x.apply(this,arguments),n=Date.now(),i=n-e,a=Math.min(a,i),l=Math.max(l,i),u.textContent=i+" D ("+a+"-"+l+")",y(g,b(1,30-i/(c||200)*30,30)),o=E(f),d=Math.min(d,o),s=Math.max(s,o),h.textContent=o+" W ("+d+"-"+s+")",y(m,b(1,30-o/(p||2500)*30,30)),t}},countWatchers:E}},ngStats=new NgStats;ngStats.setMode(1),ngStats.domElement.style.position="absolute",ngStats.domElement.style.left="0px",ngStats.domElement.style.top="0px",document.body.appendChild(ngStats.domElement),ngStats.attach(document.body,30,4000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment