Skip to content

Instantly share code, notes, and snippets.

View thakursaurabh1998's full-sized avatar
Getting Better

Saurabh Thakur thakursaurabh1998

Getting Better
View GitHub Profile
@thakursaurabh1998
thakursaurabh1998 / launch.json
Last active July 18, 2018 05:41
Build task to compile and run C file for VS Code
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
@thakursaurabh1998
thakursaurabh1998 / Election.sol
Created September 26, 2018 04:50
Smart Contract
// solium-disable linebreak-style
pragma solidity ^0.4.24;
contract Election {
struct Candidate {
uint id;
string name;
uint voteCount;
}

Saurabh Thakur (Full Stack Developer, Fresher)

Background: Saurabh is a very determined and hard working person. He is very willing to learn new things to add knowledge base and skills which can help him stand apart as a worthy aspirant. His recent achievements include third rank in Call For Code Global Hackathon conducted by Topcoder and IBM.


Skills: NodeJS, Python, RESTful API, ExpressJS, ReactJS, Redux, Firebase, SQL and Non-SQL databases, Flask, jQuery, Blockchain, Ethereum, Deployment on cloud services like heroku and Amazon AWS.


@thakursaurabh1998
thakursaurabh1998 / api.js
Created December 28, 2018 13:16
Use of promise for async requests in an array
async function LoadDefects(projectId) {
const res = await restApi.query({
type: "defects",
scope: {
workspace: "/workspace/275276784308",
project: "/project/" + projectId
}
});
let table = "<table>";
await Promise.all(
@thakursaurabh1998
thakursaurabh1998 / fib.js
Created May 11, 2019 09:39
closure example
function fib() {
let a = 0;
let b = 1;
let c;
return function() {
c = a + b;
a = b;
b = c;
return c;
}
function fib() {
let a = 0;
let b = 1;
let c = 0;
return function() {
a = b;
b = c;
c = a + b;
return b;
}
@thakursaurabh1998
thakursaurabh1998 / streamFile.js
Created April 14, 2020 09:04
Stream file and create a local buffer, after stream ends, use the buffer accordingly
const readStream = s3Mumbai.getObject(workbookfile).createReadStream();
const buffers = [];
readStream.on('data', data => {
buffers.push(data);
});
readStream.on('error', err => {
next(err);
});
{
"status": "AVAILABLE",
"offerCode": "FREE_AWI",
"includedScids": ["SCAW_0001"],
"endDate": ISODate("2020-03-13T10:00:00.000Z"),
"startDate": ISODate("2020-02-23T18:30:00.000Z"),
"discount": {
"type": "percentage",
"value": 1.0
},
{
"meta": {
"cta": {
"primary": {
"text": "See smallcases",
"action": "DISCOVER",
"query": "scids=SCAW_0001&scids=SCSB_0001&scids=SCSB_0003&scids=SCSB_0004",
"path": "/discover/all"
},
"secondary": {