(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
#Prerequisites#
npm install passport
npm install passport-local
package.json
)#Steps#
<?php | |
/* | |
Plugin Name: WDS JetPack Popular Posts | |
Plugin URI: http://www.webdevstudios.com | |
Description: Query for popular posts by views using JetPack by Automattic. | |
Version: 1.0 | |
Author: WebDevStudios | |
Author URI: http://www.webdevstudios.com | |
License: GPLv2 | |
Text Domain: wds-popular-posts |
/** | |
* api/models/User.js | |
* | |
* The user model contains the instance method for validating the password. | |
*/ | |
var bcrypt = require('bcrypt'); | |
function hashPassword(values, next) { | |
bcrypt.hash(values.password, 10, function(err, hash) { |
// controllers/LoginController.js | |
module.exports = { | |
index: function(req, res) { | |
var email = req.param('email'); | |
var password = req.param('password'); | |
// delay everthing to prevent bruteforce, dos and timing attacks | |
setTimeout(function() { |