This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaScript is a bit confusing for developers experienced in class-based languages (like Java or C++), as it is dynamic and does not provide a class implementation per se (the class keyword is introduced in ES2015, but is syntactical sugar, JavaScript remains prototype-based). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var reconnection = true, | |
reconnectionDelay = 5000, | |
reconnectionTry = 0; | |
function initClient() { | |
connectClient(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SimpleCalculator(){ | |
/*this.addnew = function(a,b){ | |
return a+b; | |
}*/ | |
this.add = function(a,b){ | |
return a+b; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// trying add(2)(3) | |
function add(a){ | |
return function(b){ | |
return a+b; | |
} | |
} | |
console.log(add(2)(4)); //6 | |
// trying add(2,3) and add(2)(4) in a same funcrtion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var human = { | |
name:'rahman', | |
dateofBirth: new Date('1962-10-9') | |
} | |
console.log(human); | |
Object.defineProperty(human,'age',{ | |
get: function(){ | |
console.log('in get'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.service('DataService', function() { | |
var productList; | |
return{ | |
setData : function(data) { | |
console.log(data); | |
productList = data | |
}, | |
getData : function(){ | |
return productList; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUNNING NODE JS APP IN BACKGROUND | |
_________________________________ | |
NSSM Setup for Creating NodeJS app windows service (This will run your program as background service on startup): | |
_________________________________________________________________________________________________________________ | |
Download NSSM from this link : https://nssm.cc/download | |
Latest use for Rangpur is NSSM 2.24 : https://nssm.cc/release/nssm-2.24.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Dump all database on a specific folder name 'backup' | |
mongodump --out C:/data/backup/ | |
2. Dump a specific collection of a specific database on specific folder | |
mongodump --collection users --db nineeng --out C:/dump_usermongodump --collection users --db nineeng --out C:/dump_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"JavaScript is a dynamic type language, means you don't need to specify type of the variable because it is dynamically used | |
by JavaScript engine. You need to use var here to specify the data type" | |
JavaScript has two type of data types, | |
1. Primitive: | |
String -represents sequence of characters e.g. "hello" | |
Number -represents numeric values e.g. 100 | |
Boolean -represents boolean value either false or true | |
Undefined -represents undefined value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b>Directive</b> | |
Directives are markers on a DOM element which attach a special behavior to it. For example, static HTML does not know how to create and display a date picker widget. | |
An Angular directive comes in four flavors in terms of appearance. | |
A new HTML element (<date-picker></date>). | |
An attribute on an element (<input type="text" date-picker/>). | |
As a class (<input type="text" class="date-picker"/>). |