This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "os" | |
| "fmt" | |
| "net/http" | |
| "io/ioutil" | |
| "log" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var getNextUrl; | |
| getNextUrl = function(url) { | |
| if (url == null) { | |
| url = "challenge"; | |
| } | |
| return $.getJSON(url, function(r) { | |
| if (r.follow) { | |
| getNextUrl(r.follow); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getNextUrl = (url="challenge") -> | |
| $.getJSON url, (r) -> | |
| getNextUrl(r.follow) if r.follow | |
| console.log r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* What it does on the page of a given youtube.com video: | |
| - Loads the HTML5 version of the current video if necessary/possible. | |
| - Mutes the video. | |
| - Stops the video after 30 seconds. | |
| - Changes the youtube logo to the colour.com one. | |
| Why? As a silly experiment to see what it's like to view muted videos limited to 30 seconds in length (the basic experience of video sharing on colour.com for now). | |
| */ | |
| if (!window.location.href.match(/html5/)) { | |
| alert("Hit this bookmarklet again once the window has re-loaded:)"); | |
| window.location.href = window.location.href + "&html5=1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:var query=/^username$/;var color="#FF3300";var offset=-10;if(!window.hnComments||!window.hnComments.length){window.hnComments=[];window.hnIndex=0;}for(x=0;x<document.getElementsByClassName("comhead").length;x++){var element=document.getElementsByClassName("comhead")[x].childNodes[0];var username=element.innerHTML;if(username&&username.match(query)&&window.hnComments.indexOf(element)<0){window.hnComments.push(element);element.style.color=color;}}if(window.hnComments&&typeof(window.hnComments[window.hnIndex])=="object"){window.hnComments[window.hnIndex].scrollIntoView();window.setTimeout("window.scrollBy(0,"+offset+");",1);window.hnIndex++;if((window.hnIndex)>=window.hnComments.length){window.hnIndex=0;}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){alert("Click the text of the comment you want a link to.");document.body.onclick=function(e){var clearance_height,element,id,offset_height,post,sibling_cursor,sibling_element,sibling_elements,sibling_ids,url,_i,_j,_len;element=e.toElement;_i=10;while(_i>0&&!id){if(element.parentNode&&element.parentNode.className==="qx rg"){id=element.parentNode.id;}element=element.parentNode;_i--;}sibling_ids=[];sibling_elements=element.parentNode.getElementsByClassName("qx rg");clearance_height=0;offset_height=0;if(window.innerHeight>=530){clearance_height+=document.getElementById("gb").offsetHeight||30;}if(window.innerHeight>=800){clearance_height+=document.getElementsByClassName("c-cb-V c-i-cb-V c-cb-V-Fi")[0].offsetHeight||60;}for(_j=0,_len=sibling_elements.length;_j<_len;_j++){sibling_element=sibling_elements[_j];sibling_ids.push(sibling_element.id);}sibling_cursor=sibling_ids.indexOf(element.id);while(offset_height<clearance_height&&sibling_cursor>0){sibling_cursor-=1;offset_height+=sibling_elemen |