Skip to content

Instantly share code, notes, and snippets.

View Shekharrajak's full-sized avatar
📚
Being Geek!

Shekhar Prasad Rajak Shekharrajak

📚
Being Geek!
View GitHub Profile
@Shekharrajak
Shekharrajak / AuthController.js
Created July 16, 2015 05:51
For the tutorial on medium.com : passportJS auth
/**
* AuthController
*
* @description :: Server-side logic for managing auths
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
var passport = require('passport');
module.exports = {
@Shekharrajak
Shekharrajak / passport.js
Created July 16, 2015 05:51
For the tutorial on medium.com : passportJS auth
var passport = require('passport'),
LocalStrategy = require('passport-local').Strategy,
bcrypt = require('bcrypt');
passport.serializeUser(function(user, done) {
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
User.findOne({ id: id } , function (err, user) {
@Shekharrajak
Shekharrajak / signup.ejs
Created July 16, 2015 05:50
For the tutorial on medium.com : passportJS auth
<div class = "col-md-6" style="left:20%;margin-top:10%">
<form action="/signup" method="POST" class="form-signin">
<h3>Create a new account..</h3>
<input type="text" class="form-control" placeholder="Email address" name="email"><br>
<input type="password" class="form-control" placeholder="Password" name="paassword"><br>
<input type="submit" class="btn btn-success center-block col-xs-12" value="Sign Up"><br>
<p style="text-align:center;margin-top:30px;">Already have an account? <a href="/login">Sign in</a></p>
<input type="hidden" value="<%= _csrf %>" name="_csrf">
@Shekharrajak
Shekharrajak / login.ejs
Last active August 29, 2015 14:25
For the tutorial on medium.com : passportJS auth
<div class = "col-md-6" style="left:20%;margin-top:10%">
<form action="/login" method="POST" class="form-signin">
<br>
<br><br>
<h3> Login here </h3>
<input type="text" class="form-control" placeholder="Email address" name="email"><br>
<input type="password" class="form-control" placeholder="Password" name="password"><br>
<input type="submit" class="btn btn-default center-block col-xs-12" value="Login"><br>
<p style="text-align:center;margin-top:30px;">Don't have an account? <a href="/signup">Sign Up</a></p>
//Not all this code is my code. This code is part of 1Sheeld.com code. It is part of their simple example-Voice Recognizer
/* if you post to much to facebook ant twitter in a short amout of time you wil not be able to post anything for a while*/
/*Keep by 140 characters when using Twitter otherwize it will not tweet*/
/* Include 1Sheeld library. */
#include <OneSheeld.h>
/* Voice commands set by the user. */
//Voice commands the 1sheeld is going to react to -- Set by the user--
const char tweetCommand[] = "tweet"; //Change the word in the brackets to your preffered word
const char facebookpostCommand[] = "post on facebook"; //DO NOT USE CAPITALS