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 HashArray() { | |
this.array = []; | |
this.hash = {}; | |
this.__defineGetter__("length", function() { | |
return this.array.length; | |
}); | |
this.set = function(key, value) { | |
if (typeof(key) === 'string') { |
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
chrome.browserAction.setPopup({ | |
popup: "popup.html" | |
}) | |
chrome.browserAction.onClicked.addListener(function() { | |
chrome.browserAction.setPopup({ | |
popup: "popup.html" | |
}) | |
}); |
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 exec(fn) { | |
var args = ''; | |
if (arguments.length > 1) { | |
for (var i = 1, end = arguments.length - 2; i <= end; i++) { | |
args += typeof arguments[i]=='function' ? arguments[i] : JSON.stringify(arguments[i]) + ', '; | |
} | |
args += typeof arguments[i]=='function' ? arguments[arguments.length - 1] : JSON.stringify(arguments[arguments.length - 1]); | |
} | |
var script = document.createElement('script'); | |
script.setAttribute("type", "application/javascript"); |
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 obj = { | |
one: null, | |
two: undefined, | |
three: 3 | |
} | |
for (var i = 0, keys = Object.keys(obj), key; key = keys[i]; i++) { | |
console.debug(obj[key]); | |
} |
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 t(s,d){ | |
for(var p in d) | |
s=s.replace(new RegExp('{'+p+'}','g'), d[p]); | |
return s; | |
} | |
t("Hello {who}!", { who: "JavaScript" }); | |
// "Hello JavaScript!" | |
t("Hello {who}! It's {time} ms since epoch.", { who: "JavaScript", time: Date.now }); |
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 string=(function () { | |
/* | |
Bleh Bleh | |
Meh | |
Huh | |
Works in FF and Chrome atleast, havent tried anywhere else | |
*/ | |
}).toString().split('\n').slice(2,-2).join('\n').trim(); |
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 dyslexia(string){return String.fromCharCode.apply(this,string.split('').map(function(a){return a.charCodeAt()^255;}))} | |
var a = "{lives:3}"; | |
var z = dyslexia(a); | |
a == dyslexia(z); |
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 evIl = function(script) { | |
blob = new Blob([script], { | |
type: "application/javascript" | |
}); | |
url = window.URL.createObjectURL(blob); | |
s = document.createElement('script'); | |
s.src = url; | |
document.head.appendChild(s); | |
window.URL.revokeObjectURL(url); | |
s.parentElement.removeChild(s); |
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 blend(element,blendMode,opacity) { | |
// this._.extraTexture.loadContentsOf(element); | |
// this._.extraTexture.use(1); | |
element._.use(1); | |
if(gl.blend == undefined){ | |
var shader= (function () { |
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
/* | |
Reserved words | |
-------------- | |
Width | |
Height | |
X | |
Y | |
Scale - not used yet but will be used to declare the scalling method and details (slice and all that) |
OlderNewer