var a = events.create()
a.listen("click:app", foo)
a.listen("click:app", foo)
a.listen("click:app", bar)
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 nativeConcat = [].concat | |
function createCurried(fn, args, length, thisValue){ | |
function curried(){ | |
var currentArgs = nativeConcat.apply(args, arguments) | |
if(length - currentArgs.length <= 0) { | |
return fn.apply(thisValue === void 0 ? this : thisValue, currentArgs) | |
} | |
return createCurried(fn, currentArgs, length, thisValue) | |
} |
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(craft){ | |
var supportsProto = typeof {}.__proto__ == "object" | |
, fragment = doc.createDocumentFragment() | |
, nodeList = supportsProto ? [] : getExternalArray() | |
, createNodeList | |
function getExternalArray(){ | |
var context = doc.createElement("iframe") | |
, proto, contextDoc |
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
/* | |
Sometimes in JavaScript you want a method to be | |
accessible in multiple contexts. | |
For instance as a static and instance method. | |
Here comes a little example. | |
*/ | |
var app = {} |
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
/* | |
How to make a domReady function | |
*/ | |
;(function(win){ | |
var doc = win.document | |
/* | |
We'll use the document.readyState string | |
to define weather or not the dom is ready. | |
The RegExp matches all the states we can |
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
/** | |
hop! | |
*/ | |
;([]+{})[+!![]+!![]+!![]+!![]+!![]]+([]+![])[+!![]]+([]+[][[]])[+!![]+!![]+!![]]+([]+[][[]])[+!![]]+([]+{})[+!![]+!![]+!![]]+([]+![])[+!![]+!![]+!![]] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>{P!}</title> | |
<style> | |
.logo { | |
position: relative; | |
height: 10em; | |
width: 10em; |
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
fetchURL("/").then(({ responseText }) => console.log(responseText)) | |
const request = fetchURL("/") | |
request.cancel() | |
request.then(() => console.log("NOT HAPPENING")) |
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(root){ | |
var _toString = {}.toString | |
, ARRAY_CLASS = "[object Array]" | |
, STRING_CLASS = "[object String]" | |
/** | |
Collection utilities | |
*/ |