Skip to content

Instantly share code, notes, and snippets.

View thedaviddias's full-sized avatar
🌍

David Dias thedaviddias

🌍
View GitHub Profile
var moment = require('moment')
, dateMask = 'YYYY-MM-DD';
var MeetingSchema = new Schema({
...
});
MeetingSchema
.virtual('startDate_yyyymmdd')
.get(function () {
@thedaviddias
thedaviddias / app.js
Last active August 29, 2015 14:10 — forked from dylants/app.js
require("express-namespace");
var express = require("express"),
fs = require("fs"),
cons = require("consolidate"),
app = express(),
passport = require("passport"),
mongoose = require("mongoose");
// 30 days for session cookie lifetime
var SESSION_COOKIE_LIFETIME = 1000 * 60 * 60 * 24 * 30;
@thedaviddias
thedaviddias / app.js
Last active August 29, 2015 14:10 — forked from pixelhandler/app.js
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
{ content:
{ sid: '516f1018384ca80000000011',
title: 'node.js news',
slug: 'node-js-news',
status: 'working',
version: 1,
permalink: 'http://storify.com/storify/node-js-news',
description: null,
thumbnail: 'http://storify.com/public/img/default-thumb.gif',
date:
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@thedaviddias
thedaviddias / SassMeister-input-HTML.html
Created March 5, 2015 12:43
Generated by SassMeister.com.
<div class="column1">
<div class="block">
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<div class="block1">
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@thedaviddias
thedaviddias / .gitignore_global
Created June 5, 2015 18:38
My gitignore global
# Sass template
###############
.sass-cache/
*.css.map
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
###############
.grunt
# node-waf configuration
@thedaviddias
thedaviddias / gist:090b419d4c15d8b9cac1
Last active August 29, 2015 14:26 — forked from chad3814/gist:2924672
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]
@thedaviddias
thedaviddias / CSS: Image Replacement
Created September 28, 2012 22:17
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent
}