Created
April 3, 2012 20:08
-
-
Save marcelbeumer/2295191 to your computer and use it in GitHub Desktop.
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
#js boiler for buzz | |
snippet buzzjs | |
/*jshint undef:true, forin:false, eqeqeq:true, browser:true, newcap:true */ | |
/*global console:true, $:true */ | |
(function (global) { // We always pass global here | |
var bm = global.bm, | |
_ = bm.util; | |
})(this); | |
# Class | |
snippet class | |
// $1 constructor | |
function ${1:class_name}(${2:argument}) { | |
${3:// body...} | |
} | |
# Subclass | |
snippet subclass | |
// $1 constructor | |
function ${1:class_name}(${2:argument}) { | |
$1.__super__.constructor.apply(this, arguments); | |
${4:// body...} | |
} | |
// Inherit from $3 | |
_.inherits($1, ${3:super_class}); | |
# Prototype | |
snippet proto | |
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { | |
${4:// body...} | |
}; | |
# Prototype with super | |
snippet protosuper | |
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { | |
$1.__super__.$2. | |
apply(this, arguments); | |
${6:// body...} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment