Skip to content

Instantly share code, notes, and snippets.

@ypetya
Last active August 29, 2015 14:18
Show Gist options
  • Save ypetya/11c2285800033d2c8ef6 to your computer and use it in GitHub Desktop.
Save ypetya/11c2285800033d2c8ef6 to your computer and use it in GitHub Desktop.
JS Tweaks / Bookmarks
javascript:(function loadThings(){ var script = document.createElement('script'); script.src=window.prompt('Enter script path to load'); document.body.appendChild(script);})()
(function checkTree(callbackFn){
function visit(node, nth){
if(callbackFn(node)) {
return false;
}
if(node.hasChildNodes()){
return expand(node.childNodes);
}
return true;
}
function expand(nodeList){
for(var i=0;i<nodeList.length;i++){
if(!visit(nodeList[i])) break;
}
}
visit(document);
}(
function(node) {
if($(node).position().x < 0){
console.info(node);
return 'stop';
}
}
));

setInterval(function(){var last=null; Array.prototype.forEach.call($('#box span'),function(span){ if(last &amp;&amp; last!==$(span).attr('style')) { span.click();console.info(span);} last=$(span).attr('style')});}, 100);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment