Skip to content

Instantly share code, notes, and snippets.

View scizers's full-sized avatar

Ishaan Sharma scizers

View GitHub Profile
@scizers
scizers / mongod.txt
Last active September 9, 2017 23:18
add admin user to mongodb
use admin
db.createUser(
{
user: "admin",
pwd: "alum123#",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)
db.createUser(
@scizers
scizers / model.js
Last active August 29, 2015 14:14
auto increment with two queries
var mongoose = require('mongoose');
var counter = mongoose.Schema({
type: { type: String, index: { unique: true }},
seq: Number
});
// create the model for users and expose it to our app
module.exports = mongoose.model('counter', counter);
@scizers
scizers / cros.js
Created March 1, 2015 18:19
Cross Origin policy
app.get('/questions/intTags' , function (req ,res) {
console.log(req.query.data)
var data = [
{ "text": "Tag1" },
{ "text": "Tag2" },
{ "text": "Tag3" },
{ "text": "Tag4" },
{ "text": "Tag5" },
{ "text": "Tag6" },
{ "text": "Tag7" },
@scizers
scizers / bash-smtp-auth-email
Created April 28, 2016 13:28 — forked from fbatschi/bash-smtp-auth-email
How to send an email from bash via SMTP Auth
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <[email protected]>" [email protected]