This file contains 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
// path/to/module/debug.js | |
var express = require('express'); | |
exports.diagnostics = function() { | |
var app1 = express.createServer(); | |
app1.configure(function() { | |
this.set('view engine', 'ejs'); | |
this.set('views', __dirname + '/views/app1'); |
This file contains 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
var debug = require('util').debug; | |
// helper prototype for rendering block scripts, stylesheet links, etc | |
var blocktag = { | |
toString: function() { | |
var tag = this.tag, | |
html = '<'+tag, | |
that = this; | |
Object.getOwnPropertyNames(this).forEach(function(prop) { |
This file contains 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
#include "Vector.h" | |
Persistent<FunctionTemplate> Vector::ctor; | |
void | |
Vector::Initialize(Handle<Object> target) { | |
HandleScope scope; | |
ctor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New)); | |
ctor->InstanceTemplate()->SetInternalFieldCount(1); |
This file contains 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
var assert = require('assert') | |
, mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, OID = Schema.ObjectId | |
, schema, model, conn, o | |
, log = console.error | |
schema = new Schema({ str: String }) | |
schema.path('str').set(function(v) { |
This file contains 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
exports.updateCollection = function(req, res, next) { | |
console.error('REQUEST UPDATE for: ', req.params.collection); | |
console.error('UPDATE DATA\n', req.body); | |
Collection.update({ _id: req.params.collection }, req.body, {}, function(err, collection) { | |
if (err) { | |
console.error('UPDATE FAILED:', err.stack || err); | |
return next(err); | |
} | |
console.error('UPDATE OK, updated:', collection); | |
res.send(collection); |
This file contains 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
var module = exports; | |
module.Type1 = function() {}; | |
module.fn1 = function() {}; |