Skip to content

Instantly share code, notes, and snippets.

View siddrc's full-sized avatar
🏠
Working from home

Siddharth Roychoudhury siddrc

🏠
Working from home
View GitHub Profile
function hello(){
alert("hello world")
}
@siddrc
siddrc / flattenArray.js
Created October 3, 2017 07:14
flattenArray
//[[1,2,[3]],4] -> [1,2,3,4]
var input = [
[[1,2,[3]],4]
];
//check if inputArrayItem is an array
//if yes process inputArrayItem again
//else put in outputArray
var output = [];
function processArray(inputArray) {
inputArray.forEach(function(inputArrayItem, inputArrayIndex) {
var express = require('express');
var app = express();
var http = require('http').Server(app);
var cfenv = require("cfenv");
var appEnv = cfenv.getAppEnv();
http.listen(appEnv.port, appEnv.bind);
app.use(express.static(__dirname + '/public'));
let bookJson = {
"_id" :1,
"books" : [ {
isbn:"ISBN1",
bookName:"Book1"
},
{
isbn:"ISBN2",
bookName:"Book2"
}]
const timeData = [{
"name" : "lect1",
"time": "2:20"
}, {
"name" : "lect2",
"time": "3:30"
}, {
"name" : "lect1",
"time": "4:40"
}, {
const array = [1,3,45,6,7,8,9];
//print the numbers greater than 10
map for multi dim array
@siddrc
siddrc / timeChaining_Solution.js
Created February 14, 2018 15:09
time chaing class code puzzle solution
const timeData = [{
"name" : "lect1",
"time": "2:20"
}, {
"name" : "lect2",
"time": "3:30"
}, {
"name" : "lect1",
"time": "4:40"
}, {
@siddrc
siddrc / DMS-README.MD
Created March 25, 2018 19:53
This is a readme file for a DMS system

Initiate project

Start a new project using

	npm init 

You can name it what you want preferably whatever name you choose should depict what the project does , it will be the backend for our document management system.

Please pay attention to each and every variable name and number of lines in each function

Modules

@siddrc
siddrc / Callback Methods.MD
Last active December 13, 2018 15:41
Revision Notes

Callback methods:

terminator-ill-be-back-arnold-meme

Yes I am a terminator fan...haha

ok coming down to nerdy talks.

Firstly from the name "Callback methods" itself, it is as if saying:

"I am going somewhere else now to do something else entirely different but a neccessity to complete this task, and I will be back with results and use it to resume and complete the flow ahead."