Skip to content

Instantly share code, notes, and snippets.

View shivasurya's full-sized avatar

Shivasurya shivasurya

View GitHub Profile
@shivasurya
shivasurya / server.js
Created September 21, 2014 06:55
node mailer - Node.js
var email = require('mailer');
email.send({
host : "smtp.gmail.com",
port : "465",
ssl : true,
domain : "i-visionblog.com",
to : "someone@someone.com",
from : "author@ivb.com",
subject : "Mailer library Mail node.js",
@shivasurya
shivasurya / auth-google.php
Created November 29, 2016 06:03
Authenticate with a Backend server (PHP) - Sign-in with Google For Android - i-visionblog
/*
MIT License
Copyright (c) [2016] [S Shivasurya]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
var express = require('express');
var http = require('http');
var app = express();
var body = require('body-parser');
var geolib = require('geolib');
app.use(body.urlencoded({ extended: false }))
// parse application/json
app.use(body.json())
@shivasurya
shivasurya / HTML5 API - i-visionblog.markdown
Created September 12, 2015 15:02
HTML5 API - i-visionblog

HTML5 API - i-visionblog

Learning to use Rich HTML5 Javascript API for enhancing web apps - i-visionblog.com

A Pen by s.shivasurya on CodePen.

License.

@shivasurya
shivasurya / server.js
Created September 21, 2014 07:01
nodemailer library - nodemailer
var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "username@gmail.com",
pass: "########################"
}
});
@shivasurya
shivasurya / server.js
Created August 28, 2014 16:40
node js API
var http = require("http");
var express = require("express");
var bodyParser = require('body-parser');
var app = express();
var mongoose = require("mongoose");
var remote_db_url = require('./database.js');
mongoose.connect(remote_db_url.url);
var movie = require('./model.js');
app.use(bodyParser());
@shivasurya
shivasurya / model.js
Created August 28, 2014 16:32
Simple Schema for mongoose DB
var mongoose = require('mongoose');
var movie_api = mongoose.Schema({
movie : {
name : String,
year : String,
director : String,
genre : String,
var mongoose = require('mongoose');
var userSchema = mongoose.Schema({
recent : {
film : String,
director : String,
musicdir :String,
rating :String,
genre :String,
thumbnail : String,
},
// server.js
// set up ======================================================================
// get all the tools we need
var path = require('path');
var express = require('express');
var app = express();
var port = process.env.OPENSHIFT_NODEJS_PORT || 8080
, ip = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
var mongoose = require('mongoose');
@shivasurya
shivasurya / script.js
Created August 7, 2014 16:10
This script.js is a third party plugin which is used to upload files via ajx with progress bar - generally using bootstrap
$(function() {
var showInfo = function(message) {
$('div.progress').hide();
$('strong.message').text(message);
$('div.alert').show();
};
$('input[type="submit"]').on('click', function(evt) {
evt.preventDefault();