Skip to content

Instantly share code, notes, and snippets.

View vijaydeepak-tt's full-sized avatar
💭
I may be slow to respond.

Vijay Deepak vijaydeepak-tt

💭
I may be slow to respond.
View GitHub Profile
mongod --dbpath "local db path(EX: F:\mongoDataBase\data)" ---> setting th db path in our local system.
mongo ---> starts the db.
mongodump ---> it will backups the database, inside the bin folder inside the dump folder.
mongorestore ---> restores all the backuped datas.
mongodump --db dbName ---> backups selected database.
1) use dbName --- goes to selected db, if it not exist it will create a new db on that name.
2) db --- returns the name of the current db we selected
3) show dbs --- returns the list of dbs which contains any datas.
4) db.collectionName.insert(json object) --- inserts a data inside the selected collection name.
5) db.dropDatabase() --- drops the current database.
@vijaydeepak-tt
vijaydeepak-tt / React Routing- get params
Created November 22, 2017 04:29
to get the parameter values passed in the url
Syntax to get the params passed in url:
this.props.match.params.userDefinedParam
@vijaydeepak-tt
vijaydeepak-tt / es6
Last active December 13, 2017 15:04
Required files and details
Installation:
npm i --save-dev webpack
npm i --save-dev babel-core babel-loader webpack-dev-server babel-preset-es2015 babel-polyfill
Html:
/build/index.html
@vijaydeepak-tt
vijaydeepak-tt / Ionic Setup - Required Commands
Last active October 8, 2018 06:19
A basic required commands used in the ionic application.
install ionic cordova -g ---> Installing ionic cli in global
ionic start <projectname> <templatename> ---> To create the ionic project
ionic serve - to run the application in the browser.
ionic lab - to run the application in browser window with 3 platform screens.
ionic cordova platform add android or ios ---> to setup the platform
ionic cordova resources ---> creates the icon and splash images of different sizes of our images and splash paste in the resources folder.
ionic cordova run android ---> to run the application on the Androis SDK device.
ionic cordova run android -l ---> this cmd enables the live reload of the application.
ionic generate component, directive, page, pipe, provider, tabs ---> used to generate any of the mention, use only one at a time.
ionic plugin add <pluginname> - used to add any plugins in the project.
@vijaydeepak-tt
vijaydeepak-tt / git(DVCS - Distributed Virsion Control System) - bash cmd's
Last active July 9, 2019 04:36
Commands used in the git-bash for development
git(DVCS - Distributed Virsion Control System) - bash cmd's:
git - bash common CMD's:
cd .. --> go back directory.
pwd --> returns the full path of the repository.
clear --> clears the bash.
@vijaydeepak-tt
vijaydeepak-tt / Generate APK file
Created February 27, 2018 04:20
A commands to generate the APK for the Ionic or React native projects.
#Generate APK:
run "ionic cordova build --release android".
It generates the unsigned apk file.
#Sign The Apk:
Check Keytool in cmd, if working no problem, otherwise install jdk and add the jdk bin path to the path Environment Variable.(C:\Program Files\Java\jdk1.7.0_79\bin)
const array = [{age:44,name:'vinay'},{age:24,name:'deepak'},{age:74,name:'suresh'}];
const sort = (type, array, direction) => {
return array.slice(0).sort(function(a,b) {
if(direction==='asc') {
return (a[type] > b[type]) ? 1 : (a[type] < b[type]) ? -1 : 0;
}
else if(direction==='dec') {
return (a[type] > b[type]) ? -1 : (a[type] < b[type]) ? 1 : 0;
@vijaydeepak-tt
vijaydeepak-tt / Dart in VS Code
Last active February 17, 2020 03:50
Commands to create and run Dart Application through VS Code
1. Install "Dart Code" extention for VS Code.
2. run "pub global activate stagehand" with your Terminal
"pub global activate webdev"
3. Add the Path "C:\Users\<username>\AppData\Roaming\Pub\Cache\bin" to the environment variable path.
Install Chocolatey for Dart cli update:
run "choco upgrade chocolatey" to update.
@vijaydeepak-tt
vijaydeepak-tt / Flutter - Basic Setup and CMD's
Last active April 29, 2018 05:53
A Flutter Application basic setup details and command's use while Developing
Flutter:
SetUp:
1. install git.
2. run "git clone -b beta https://github.com/flutter/flutter.git" in cmd promt.
3. Add the ..//path\flutter\bin to the environmet PATH variable.
4. Rerun the cmd promt and type "flutter", to chech it is working correct.
5. run "flutter doctor" cmd to check the required dependencies.
6. run "flutter upgrade" cmd to upgrade the package