Edit /etc/apt/sources.list
and add the following lines to the bottom of the file:
# MongoDB
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Then run the following commands:
/* Overwrite localStorage w/ cookie-based storage if browser does not support */ | |
if(typeof localStorage === "undefined" || localStorage === null){ | |
(function(){ | |
function getExpiration(isRemove){ | |
var date = new Date(); | |
if(isRemove){ | |
date.setTime((+date)-1000); //sometime in past | |
} else { | |
date.setTime((+date)+30758400000); //356 days ahead | |
} |
//sample proxy server for node.js from http://www.catonmat.net/http-proxy-in-nodejs | |
var http = require('http'); | |
http.createServer(function(request, response) { | |
var proxy = http.createClient(80, request.headers['host']) | |
var proxy_request = proxy.request(request.method, request.url, request.headers); | |
proxy_request.addListener('response', function (proxy_response) { | |
proxy_response.addListener('data', function(chunk) { | |
response.write(chunk); |
#from http://www.sergeychernyshev.com/blog/speed-up-your-site-drop-in-htaccess-file/ | |
<IfModule mod_deflate.c> | |
# Insert filter | |
SetOutputFilter DEFLATE # Netscape 4.x has some problems... | |
BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 | |
# the above regex won't work. You can use the following | |
# workaround to get the desired effect: | |
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don't compress images |
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
/** | |
* Arc model | |
* | |
* @module Arc | |
* @requires mongoose (npm install mongoose) | |
* @requires User (models/User.js) | |
* @global mongoose | |
*/ | |
var Schema = mongoose.Schema, | |
User = require('./User.js'); |
function render(view,locals){ | |
return function(req,res){ | |
res.render(view,locals || {}); | |
}; | |
} | |
var render = #(view,locals){ | |
return #(req,res){ | |
res.render(view,locals || {}); | |
} |
info it worked if it ends with ok | |
verbose cli [ 'node', '/usr/local/bin/npm', 'install' ] | |
info using npm@1.0.15 | |
info using node@v0.4.8 | |
verbose config file /home/jdevries/.npmrc | |
verbose config file /usr/local/etc/npmrc | |
silly testEngine { author: { name: 'Marc Harter', email: 'wavded@gmail.com' }, | |
silly testEngine name: 'rowe-law', | |
silly testEngine version: '0.0.1', | |
silly testEngine repository: { url: '' }, |
#!/usr/bin/env coffee | |
global.mongoose = require 'mongoose' | |
mongoose.connect 'mongodb://localhost/test' | |
Schema = mongoose.Schema | |
User = new Schema | |
userId : { type: String, index: true, required: true } | |
contacts : [ { type: Schema.ObjectId, ref: 'User' } ] |
#!/usr/bin/env coffee | |
global.mongoose = require 'mongoose' | |
mongoose.connect 'mongodb://localhost/test' | |
Schema = mongoose.Schema | |
User = new Schema | |
userId : { type: String, index: true, required: true } | |
contacts : [ { type: Schema.ObjectId, ref: 'User' } ] |
Edit /etc/apt/sources.list
and add the following lines to the bottom of the file:
# MongoDB
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Then run the following commands: