Skip to content

Instantly share code, notes, and snippets.

View morwoen's full-sized avatar
:octocat:
:octocat:

Georgi Tsaklev morwoen

:octocat:
:octocat:
View GitHub Profile
@juandopazo
juandopazo / lib.js
Created November 15, 2011 14:21
Function.prototype.extend for simple classes in ES5
Object.getOwnPropertyDescriptors = function getOwnPropertyDescriptors(obj) {
var descriptors = {};
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
descriptors[prop] = Object.getOwnPropertyDescriptor(obj, prop);
}
}
return descriptors;
};
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/