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
// ==UserScript== | |
// @name Useful Scripts | |
// @version 1.3.0 | |
// @description Useful scripts for developers, to be loaded and used in every page | |
// @match http://**/* | |
// @author Guilherme Ventura | |
// @downloadURL https://rawgit.com/danguilherme/2e6e913ebdd491b06225/raw/useful_scripts.user.js | |
// @grant unsafeWindow | |
// ==/UserScript== | |
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
-- COMING SOON |
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
function Enum(items, startingValue) { | |
var count = startingValue || 0, | |
item; | |
for (var i = 0; i < items.length && (item = items[i]) ; i++) { | |
var splitted = item.split(':'); | |
if (splitted.length == 2) { | |
count = Number(splitted[0]); | |
item = splitted[1]; | |
} | |
this[this[item] = count++] = item; |
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
function loadScript(url,callback) { | |
var element = document.createElement("script"); | |
element.src = url; | |
document.body.appendChild(element); | |
element.onload = callback; | |
return element; | |
} |
NewerOlder