Skip to content

Instantly share code, notes, and snippets.

View jefferysmith's full-sized avatar

Jeff Smith jefferysmith

View GitHub Profile
import org.apache.catalina.loader.WebappLoader
eventConfigureTomcat = { tomcat ->
def newContextRoot = "/extjs_src"
File newContextPath = new File( "C:/Developer/Tools/javascript/ext-4.2.0.663/src" )
if( newContextPath.exists() ) {
context = tomcat.addWebapp( newContextRoot, newContextPath.getAbsolutePath() )
context.reloadable = true
WebappLoader loader = new WebappLoader( tomcat.class.classLoader )
@geddski
geddski / nesting.js
Created January 14, 2012 05:08
helper function for nesting backbone collections.
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];