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
// Create the record we will test modify | |
var mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, crypto = require('crypto') | |
, sys = require('sys') | |
, User | |
; | |
function defineModels(mongoose, fn) { | |
var Schema = mongoose.Schema |
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 mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, crypto = require('crypto') | |
, sys = require('sys') | |
, User | |
; | |
function defineModels(mongoose, fn) { | |
var Schema = mongoose.Schema | |
, ObjectId = Schema.ObjectId |
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 mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, crypto = require('crypto') | |
, sys = require('sys') | |
, User | |
; | |
function defineModels(mongoose, fn) { | |
var Schema = mongoose.Schema | |
, ObjectId = Schema.ObjectId |
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
/*! | |
* Alternative to Connect - Multipart | |
* Copyright(c) 2010, 2011 TJ Holowaychuk <[email protected]>, Dan MacTough <[email protected]> | |
* MIT Licensed | |
*/ | |
/** | |
* Module dependencies. | |
*/ |
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
Model.post('init', function() { | |
if (!this.isNew) { | |
var my = this | |
, activePaths = Object.keys(this._activePaths.states.init); | |
Object.keys(my._doc).forEach(function(path){ | |
if (activePaths.indexOf(path) === -1) { | |
delete(my._doc[path]); | |
} | |
}); | |
this._doc = my._doc; |
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 mongoose = require('mongoose'); | |
mongoose.connect('localhost', 'testing_535'); | |
console.error('mongoose version', mongoose.version); | |
var OID = mongoose.Types.ObjectId; | |
var ASchema = new mongoose.Schema({ | |
square: mongoose.Schema.ObjectId | |
, task: Number | |
}); |
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
html | |
body | |
h1 My Site | |
p Welcome to my super lame site. | |
include template.jqtl |
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
grep "rel=\"canonical\"" * | awk '{ OFS = ""; ORS = ","; file = substr($1, 0, 4); href = match($0, /http:\/\/[^\"]+/); print "\"", file, "\": \"", substr($0, RSTART, RLENGTH), "\""}' | awk '{ OFS = ""; ORS = ""; len = length($0); print "{", substr($0, 1, len - 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 mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, ObjectId = Schema.ObjectId | |
; | |
mongoose.connect('mongodb://localhost/test_update_getters_setters_defaults'); | |
var Fooschema = new Schema ({ | |
name : { type: String, default: 'foo', required: true } | |
, date : Date |
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
Installed Packages | |
ConsoleKit.i686 0.4.2-3.fc14 @updates | |
ConsoleKit-libs.i686 0.4.2-3.fc14 @updates | |
ConsoleKit-x11.i686 0.4.2-3.fc14 @updates | |
GConf2.i686 2.31.91-1.fc14 @fedora | |
GConf2-gtk.i686 2.31.91-1.fc14 @fedora | |
ImageMagick.i686 6.6.4.1-16.fc14 installed | |
ModemManager.i686 0.4.998-1.git20110706.fc14 installed | |
ORBit2.i686 2.14.19-1.fc14 @fedora | |
SDL.i686 1.2.14-11.fc14 @updates |
OlderNewer