Skip to content

Instantly share code, notes, and snippets.

Working from home

Foram Sojitra FSojitra

Working from home
Block or report user

Report or block FSojitra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View moment.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
var divUtc = $('#divUTC');
View convert_file_htmltopdf.js
var express = require('express');
var fs = require('fs');
var pdf = require('html-pdf');
var app = express();
app.get('/',function(req, res){
var html = fs.readFileSync('./test/test.html', 'utf8');
var options = { format: 'Letter' };
pdf.create(html, options).toFile('./test.pdf', function(err, resp) {
View api_call_throuh_request.js
var express = require("express");
var app = express();
var request = require('request');
var options = {
method: 'get',
headers: {
FSojitra / faker.js
Created Nov 21, 2017
Using Faker.js to add or display fake data into your web app or you can use it if you don't have Database but you want data to display in web app.
View faker.js
//you have to install two dependency "npm install express" and "npm install faker"
var express = require('express');
var faker = require('faker');
var app = express();
app.get('/', function(req, res){
FSojitra / index.ejs
Last active Nov 20, 2017
code to upload file to the server with extension using express.js and multer
View index.ejs
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<form method="post" enctype="multipart/form-data"><input type="text" name="a">
<input id="file" type="file" name="photo" />
<button type="submit">test</button>
You can’t perform that action at this time.