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('YOUR_MONGODB_PATH'); | |
var Schema = mongoose.Schema; | |
var ArticleSchema = new Schema({ | |
id : String, | |
title : String, | |
body : String, | |
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
function extend(destination, source, overwrite) { | |
if(typeof overwrite === 'undefined') { | |
overwrite = true; | |
} | |
for(var property in source) { | |
if(source.hasOwnProperty(property)) { | |
if(!destination[property] || overwrite) { | |
destination[property] = source[property]; | |
} | |
} |
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
set nocompatible " Forget vi. | |
call pathogen#infect() " Set up pathogen | |
syntax on | |
filetype plugin indent on | |
" Keep the buffer around when switching between buffers | |
set hidden | |
" Show what mode i'm in |
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
/*** | |
* Local storage shim | |
* Taken from https://gist.github.com/remy/350433 | |
* Local storage detection taken from https://gist.github.com/paulirish/5558557 | |
* Modified to add {encode/decode}URIComponent to fix Safari's cookie semi-colon freak out. | |
***/ | |
function doesLocalStorageEvenWork() { | |
try { | |
var str = "localStorage"; | |
window.localStorage.setItem(str, str); |