This file contains hidden or 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
createCounter = function () { | |
var counter = {}; | |
return Proxy.create({ | |
get : function (key) { | |
if (! (key in counter) { | |
counter.key = 0; | |
} | |
console.log("Вы вызвали свойство " + key + " " + (++counter) + " раз" | |
} | |
}); |
This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Quby <art543484 at ya.ru> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
/* | |
* Author : Artem Smirnov <[email protected]> | |
* | |
* Examples : | |
* anim(function (time) { | |
* console.log(time.elapsed); | |
* }); | |
* | |
* anim(function (time) { | |
* console.log(time.before); |
This file contains hidden or 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
_(style) | |
.chain() | |
.keys() | |
.filter(function (key) { | |
return 0 <= key && key <= 1; | |
}) | |
.each(function (key) { | |
colors.push(key, [style[key]]) | |
}); |
This file contains hidden or 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 () { | |
if (!Worker) //Detect IE | |
document.location = "http://www.whatbrowser.org/ru/browser/"; | |
})(); |
This file contains hidden or 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
Class = (function () { | |
var Extend = function (Child, Parent) { | |
for (var prop in Parent.prototype) | |
Child.prototype[prop] = Parent.prototype[prop]; | |
} | |
return function (Class) { | |
var Constructor = Class.Init || function () {}; | |
Constructor.prototype = Class; |
This file contains hidden or 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
// If you're a glutton for punishment, and/or claim | |
// that JavaScript libraries have too much "bloat", | |
// use this to force yourself to write JS longhand. | |
(function(window) { | |
function screwed() { | |
window.$ = null; | |
window.$A = null; | |
window.$F = null; | |
window.$H = null; |
This file contains hidden or 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
#page { | |
position : absolute ; | |
border-right : 5px solid #9E9E9E ; | |
left : 10% ; | |
width : 50% ; | |
top : 0px ; | |
} | |
h1 > a { |
This file contains hidden or 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
/* | |
Let's write a Point constructor, that have 3 types of call | |
Point(x,y); | |
Point([x,y]); | |
Point({x:x, y:y}); | |
We can make many checks but with Sugar.js we can just write | |
*/ | |
function Point () { | |
sugar(arguments, this) |