Skip to content

Instantly share code, notes, and snippets.

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

Md. Nahiduzzaman Rose Nahiduzzaman

🏠
Working from home
View GitHub Profile
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).
@Nahiduzzaman
Nahiduzzaman / client.js
Created March 11, 2017 19:34 — forked from jamilservicos/client.js
socket.io multiples fix
'use strict';
var reconnection = true,
reconnectionDelay = 5000,
reconnectionTry = 0;
function initClient() {
connectClient();
}
function SimpleCalculator(){
/*this.addnew = function(a,b){
return a+b;
}*/
this.add = function(a,b){
return a+b;
}
}
// 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
var human = {
name:'rahman',
dateofBirth: new Date('1962-10-9')
}
console.log(human);
Object.defineProperty(human,'age',{
get: function(){
console.log('in get');
.service('DataService', function() {
var productList;
return{
setData : function(data) {
console.log(data);
productList = data
},
getData : function(){
return productList;
}
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
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
"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
<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"/>).