2.147.483.647
This file contains hidden or 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
//NPM: instalar solo dependencia de desarrollo | |
npm install --only=dev | |
//NPM instalar solo dependencias de produción | |
npm install --production |
This file contains hidden or 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 $ = require('jquery'); | |
var salvattore = require('../libs/salvattore.js'); | |
var tim = require('./tim.js'); | |
var $window = $(window); | |
var $header = $('.header'); | |
var waiting = false, endScrollHandle; | |
var $grid = $('.cards-pic'); | |
var delta; |
This file contains hidden or 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
router.post('/login', passport.authenticate('local-login', { | |
successRedirect: '/', | |
failureRedirect: '/login', | |
failureFlash: true | |
})); |
This file contains hidden or 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
// load all the things we need | |
// http://scotch.io/series/easy-node-authentication | |
var LocalStrategy = require('passport-local').Strategy; | |
var FacebookStrategy = require('passport-facebook').Strategy; | |
var TwitterStrategy = require('passport-twitter').Strategy; | |
var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; | |
// load up the user model | |
var User = require('../app/models/user'); |
This file contains hidden or 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 randomTwoValues(val1, val2){ | |
return Math.random() < 0.5 ? val1 : val2; | |
} |
This file contains hidden or 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
const ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
const LENGTH = 8; | |
function hash() { | |
let tmp = ''; | |
for (let i = 0; i < LENGTH; i++) { | |
tmp += ALPHABET.charAt(Math.floor(Math.random() * ALPHABET.length)); | |
} | |
return tmp; |
This file contains hidden or 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 db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |
This file contains hidden or 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
1365 = Action & Adventure | |
77232 = Asian Action Movies | |
46576 = Classic Action & Adventure | |
43040 = Action Comedies | |
43048 = Action Thrillers |
This file contains hidden or 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 Hello(){ | |
console.log('execute something'); | |
return null; | |
} | |
let hrStart = process.hrtime() | |
//script o lo que sea a ser medido por hrtime | |
hello() | |
let hrEnd =process.hrtime(hrStart) | |
console.info("Execution time (hr): %ds %dms", hrEnd[0], hrEnd[1]/1000000) |