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
Object.keys(Object(Array(10)+0)).map(Number) |
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
[].map.call( Array(10)+1, Function.call.bind(Number) ) |
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 classes(){ | |
return [].filter.call(arguments, Boolean).map(function(a){ | |
return typeof a === "object" ? | |
(Array.isArray(a) ? | |
cn.apply(0,a) : | |
Object.keys(a).filter(function(k){return a[k];}).join(" ")) : | |
a; | |
}).filter(String).join(" "); | |
} |
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 r=[ | |
{url:"/Steel/Steel%20Band%20Music%20Of%20The%20Carribbean-09-Native%20Mambo.mp3", | |
name:"Steel Band Music Of The Carribbean-09-Native Mambo",src:"ZM3xplefSl"}, | |
{url:"/Steel/Steel%20Band%20Music%20Of%20The%20Carribbean-08-Jungle.mp3", | |
name:"Steel Band Music Of The Carribbean-08-Jungle",src:"ZM3xplefSl"}, | |
{url:"/Steel/Steel%20Band%20Music%20Of%20The%20Carribbean-07-LaPaloma.mp3", | |
name:"Steel Band Music Of The Carribbean-07-LaPaloma",src:"ZHdf478Dwd"}, | |
{url:"/Steel/Steel%20Band%20Music%20Of%20The%20Carribbean-06-Zulu%20Chant.mp3", | |
name:"Steel Band Music Of The Carribbean-06-Zulu Chant",src:"ZM3xplefSl"}, | |
{url:"/Steel/Steel%20Band%20Music%20Of%20The%20Carribbean-05-Spear%20Dance.mp3", |
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 isSorted(arr, fn){ | |
return !arr.some(function(a,b,c){ | |
if(!b) return; | |
return fn(a, c[b-1])!==1; | |
}); | |
} |
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 ViewModel(rootElement){ | |
rootElement = rootElement || document; | |
var model = Object.create(null); | |
function updateElement(elm){ | |
var key = elm.getAttribute("bind"), | |
pre = elm.getAttribute("pre") || "", |
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 counter=1; | |
addEventListener("plus", function(e){ | |
console.log(counter++); | |
}); | |
dispatchEvent(new Event("plus")); | |
dispatchEvent(new Event("plus")); | |
dispatchEvent(new Event("plus")); |
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 screenShotDialog = document.createElement("DIALOG"); | |
document.body.appendChild(screenShotDialog).innerHTML="Hello World"; | |
screenShotDialog.showModal(); |
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 cache(size, duration) { | |
// an object cache, where you can set max size or time or both, and it maintains shit for you, and quickly too | |
var index = {}, stack = [], | |
count = 0; | |
size = size || 100; | |
duration = duration || 1000 * 60 * 5; | |
function add(key, val) { | |
count++; |
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 survey(object) { | |
function scan(ob, p, x) { | |
var k, v; | |
for(k in ob) { | |
if(!ob.hasOwnProperty(k)) continue; | |
v=ob[k]; | |
if(typeof v === "object" && v && !+v) { | |
scan(v, p + "." + k, x); | |
} else { |
OlderNewer