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
const modhash = window.reddit.modhash; | |
const width = 33; | |
const height = 9; | |
var sec = 0, index = Math.floor(Math.random() * (width * height)); | |
setInterval(() => console.log("Drawing in " + (sec--) + " seconds"), 1e3); | |
const draw = seconds => { | |
index++ | |
index = index % (width * height); | |
sec = seconds = Math.ceil(seconds) | |
setTimeout(() => { |
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
const modhash = window.reddit.modhash; | |
const width = 60; | |
const height = 10; | |
var sec = 0, index = Math.floor(Math.random() * (width * height)); | |
setInterval(() => console.log("Drawing in " + (sec--) + " seconds"), 1e3); | |
const draw = seconds => { | |
index++ | |
index = index % (width * height); | |
sec = seconds = Math.ceil(seconds) | |
setTimeout(() => { |
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
var redirect = function (location) { | |
var iframe = document.createElement('iframe'); | |
iframe.setAttribute('src', location); | |
iframe.setAttribute('width', '1px'); | |
iframe.setAttribute('height', '1px'); | |
document.documentElement.appendChild(iframe); | |
iframe.parentNode.removeChild(iframe); | |
iframe = null; | |
}; |
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
// Track copied content adapted from Onderweg & Tim Down by Robert Kingston - http://www.optimisationbeacon.com/ | |
// Get Selection Text function by Tim Down - http://stackoverflow.com/a/5379408/458627 | |
function getSelectionText() { | |
var e = ""; | |
if (window.getSelection) { | |
e = window.getSelection().toString() | |
} else if (document.selection && document.selection.type != "Control") { | |
e = document.selection.createRange().text | |
} | |
return e |