Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/* Simple JavaScript Inheritance | |
* By John Resig http://ejohn.org/ | |
* MIT Licensed. | |
*/ | |
// Inspired by base2 and Prototype | |
(function(){ | |
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
this.Class = function(){}; |
/** | |
* Bind context for the given function | |
* | |
* @example: | |
* var Person = { | |
* name: 'John' | |
* }; | |
* function walk() { | |
* console.log(this.name + ' walks'); | |
* } |
/** | |
* Add inherited properties for object | |
* | |
* @param {object} properties - inheritable properties | |
* @param {object} obj - inheritable object | |
*/ | |
function include(properties, obj) { | |
var included = properties.included; | |
for(var name in properties) { | |
obj.prototype[name] = properties[name]; |
/** | |
* Add static properties for object | |
* | |
* @param {object} properties - extendable properties | |
* @param {object} obj - extended object | |
*/ | |
extend: function(properties, obj) { | |
var extended = properties.extended; | |
for(var name in properties) { | |
obj[name] = properties[name]; |
/** | |
* Check if elem contains within array | |
* | |
* @param array | |
* @param elem checking value | |
* @returns {int} | |
*/ | |
inArray: function(array, elem) { | |
var indexOf = [].indexOf; | |
if (indexOf) { |
/** | |
* Creates new object and sets its prototype with given | |
* | |
* @param o inherited object | |
* @returns {object} | |
*/ | |
create: function(o) { | |
if (Object.create) { | |
return Object.create(o); | |
} |
/** | |
* Functional Prototype Inheritance Pattern | |
* @author E.Dubskiy | |
* @email e.dubskiy@gmail.com | |
* @example: | |
* var Animal = new Class, | |
* Dog = new Class(Animal); | |
* Dog.include({ | |
* bark: true | |
* }); |
# Original http://wonko.com/post/simple-makefile-to-minify-css-and-js (Thank you by the way) | |
# Patterns matching CSS files that should be minified. Files with a -min.css | |
# suffix will be ignored. | |
CSS_FILES = $(filter-out %-min.css,$(wildcard \ | |
public/css/*.css \ | |
public/css/**/*.css \ | |
)) | |
# Patterns matching JS files that should be minified. Files with a -min.js | |
# suffix will be ignored. |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
// Create global namespace | |
App = {}; | |
// Attach your singletone method as shortcut inside | |
App.Event = (function() { | |
var instance; | |
return function() { | |
if (!instance) { | |
instance = new Event(); | |
} |