Thursday, 31 May 2018

moment js R&D

const moment = require('moment');
const _ = require('lodash');
const now = (new Date(_.now())).getTime();
const currentDateTime = moment();
const currentDateTime1 = moment("12 Oct, 2017 23:59:59" );
console.log("current dateTime",currentDateTime);
console.log(now);
console.log("pawan",moment().valueOf());
console.log("given date and time",currentDateTime1);


const moment = require('moment');
const _ = require('lodash');
const currentDateTime = moment();
const releseDateTime = moment("12 Oct, 2017 23:59:59");
const seatingDateTime = moment("19 Oct, 2017 23:59:59");
let currentPhase;
console.log(currentDateTime);
console.log(releseDateTime);
console.log(seatingDateTime);
if (currentDateTime.isSameOrBefore(releseDateTime)) {
console.log("1");
} else if (currentDateTime.isAfter(releseDateTime) && currentDateTime.isSameOrBefore(seatingDateTime)) {
console.log("2");
} else {
console.log("3");
}

var constants= {
"PHASE_NO_DATES": 'nodates',
"PHASE_DATES": 'dates',
"PHASE_SEATING": 'seating'
}

how to return all matched element from array of object

Thursday, 24 May 2018

AWS error

gives error when
file not included properly.


Unable to import module 'lib/index': Error

Wednesday, 23 May 2018

GPG git `hub

1. cd ~/.gnupg/
2. touch gpg-agent.conf
3. vi gpg-agent.conf
4. press 'i' and copy/paste the below contents:
# Connects gpg-agent to the OSX keychain via the brew-installed
# pinentry program from GPGtools. This is the OSX 'magic sauce',
# allowing the gpg key's passphrase to be stored in the login
# keychain, enabling automatic key signing.

pinentry-program /usr/local/bin/pinentry-mac
5. gpg --list-keys
6. gpg --armor --export <KEY_ID>
7. git config --global user.signingkey <KEY_ID>
8. git config --global gpg.program /usr/local/bin/gpg
9. git config --global commit.gpgsign true