This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
var mongoose = require('./index') | |
, TempSchema = new mongoose.Schema({ | |
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']} | |
}); | |
var Temp = mongoose.model('Temp', TempSchema); | |
console.log(Temp.schema.path('salutation').enumValues); | |
var temp = new Temp(); | |
console.log(temp.schema.path('salutation').enumValues); |
// Created by Nando Vieira | |
String.prototype.normalize = function() { | |
var from = "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŕŕ"; | |
var to = "aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyrr"; | |
var value = this; | |
for(var i = 0; i < from.length; i++) { | |
char_re = new RegExp(from.charAt(i), "gim"); | |
value = value.replace(char_re, to.charAt(i)) | |
}; |
{% for post in site.posts %} | |
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3> | |
<p><small><strong>{{ post.date | date: "%B %e, %Y" }}</strong> . {{ post.category }} . <a href="http://erjjones.github.com{{ post.url }}#disqus_thread"></a></small></p> | |
{% endfor %} |
// Based off example code from Hal Robertson | |
// https://github.com/halrobertson/test-restify-passport-facebook | |
// See discussion: https://groups.google.com/forum/?fromgroups#!topic/passportjs/zCz0nXB_gao | |
var restify = require('restify') | |
// config vars | |
var FB_LOGIN_PATH = '/api/facebook_login' | |
var FB_CALLBACK_PATH = '/api/facebook_callback' | |
var FB_APPID = '<<YOUR APPID HERE>>' |
// Go to https://gist.github.com/letanure/3012978 |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
var express = require('express'); | |
var app = express(); | |
var port = process.env.PORT || 5000; | |
var request = require('request'); | |
var zlib = require('zlib'); | |
var Q = require("q"); | |
var phantom=require('node-phantom'); | |
function promisify(nodeAsyncFn, context, modifier) { | |
return function() { | |
var args = args = Array.prototype.slice.call(arguments); | |
var defer = Q.defer() | |
args.push(function(err, val) { |