This file contains 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
def paginate(min: Int, max: Int, selected: Int): String = { | |
require(selected <= max, "selected can't be bigger than max") | |
require(selected >= min, "selected can't be less than max") | |
require(max >= min, "max can't be bigger than min") | |
val winMax = Math.min(Math.max(min + 9, selected + 4), max) | |
val winMin = Math.max(Math.min(max - 8, selected - 5), min) | |
val prev = if (selected > min) "< " else "" | |
val next = if (selected < max) " >" else "" |
This file contains 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
document.body.addEventListener("copy", function(ev) { ev.stopPropagation(); return false; }, true); |
This file contains 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(){var scripts=document.getElementsByTagName("script");for(var i=0,l=scripts.length;i<l;i++)scripts[i].textContent="";var styles=document.getElementsByTagName("style");for(var i=0,l=styles.length;i<l;i++)styles[i].textContent="";var links=document.getElementsByTagName("link");for(var i=0,l=links.length;i<l;i++)if(links[i]&&links[i].parentNode)links[i].href="about:blank";var allElements=document.getElementsByTagName("*");for(var i=0,l=allElements.length;i<l;i++){allElements[i].removeAttribute("style");allElements[i].className="";allElements[i].id=""}var headers=document.querySelectorAll("h1, h2, h3, h4, h5, h6");for(var h=0,l=headers.length;h<l;h++){headers[h].innerHTML="<marquee>"+headers[h].innerHTML+"</marquee>";var hr=document.createElement("hr");hr.size=6;headers[h].parentNode.insertBefore(hr,headers[h])}document.body.style.background="url('http://erikgibb.com/blog/wp-content/uploads/2007/09/_images_Stars.gif')";document.body.style.padding="20px 16%";document.body.style.fontFamily="Tim |