A Pen by Nelson Reina on CodePen.
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
/** | |
* Created by nelsonreina on 5/13/15. | |
*/ | |
function showView(request, response){ | |
var data = {title:"My Awesome Title", message:"Hello Handlebars"}; | |
response.render('home', data); | |
} | |
function getToppings(request, response){ |
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
/** | |
* Created by nelsonreina on 5/14/15. | |
*/ | |
var gulp = require('gulp'), | |
nodemon = require('gulp-nodemon'), | |
jshint = require('gulp-jshint'); | |
var jsFiles = './public/js/**/*.js'; | |
gulp.task('default', ['jshint', 'nodemon', 'watch']); |
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
/** | |
* Created by nelsonreina on 5/16/15. | |
*/ | |
require('string-format-js'); | |
var forIn = require('lodash').forIn; | |
var token = require('./token'); | |
function prettifyMongoError(error) { | |
var message = ''; |
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
require('string-format-js'); | |
require('colors'); | |
moment = require('moment'); | |
exports.logger = function(req, res, next){ | |
var time = '%s'.gray.format(moment().format('hh:mm:ss')); | |
var method = req.method; | |
var path = req.path; | |
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; | |
var logText = '[%s] %s %s %s'.format(time, ip, method, path); |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
config.vm.network :private_network, ip: "10.11.12.13" | |
config.vm.provider "virtualbox" do |vb| |
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 passport = require('passport'); | |
var localStrategy = require('passport-local').Strategy; | |
passport.use(new localStrategy(basicAuth)); | |
passport.serializeUser(function(user, done) { | |
done(null, user.id); | |
}); | |
passport.deserializeUser(function(id, done) { |
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 passport = require('passport'); | |
var basicStrategy = require('passport-http').BasicStrategy; | |
passport.use(new basicStrategy(basicAuth)); | |
passport.serializeUser(function(user, done) { | |
done(null, user.id); | |
}); | |
passport.deserializeUser(function(id, done) { |
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
import React from 'react'; | |
export const getGridRowColumns = (data, columns, Component, props ) => { | |
let retRows = []; | |
const rowCount = Math.ceil(data.length/ columns); | |
for (let i = 0; i < rowCount; i++) { | |
let rowData = []; | |
for (let x = 0; x < columns; x++) { | |
rowData.push( data[x + (i * columns)]) | |
} |
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
rsync -avzh ./${fromFolder}/ ${user}@${host}:/${folder} |
OlderNewer