Skip to content

Instantly share code, notes, and snippets.

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

Mohit Patel patelmohit719

🏠
Working from home
View GitHub Profile
@patelmohit719
patelmohit719 / webpack.config.js
Created June 16, 2022 06:58
Simple webpack config to bundle html, css, and 3rd party libraries.
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
mode: 'development',
entry: {
bundle: path.resolve(__dirname, 'src/index.js'),
},
@patelmohit719
patelmohit719 / filterArray.js
Created January 9, 2022 15:10 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@patelmohit719
patelmohit719 / docker-clean.sh
Created August 18, 2021 18:12
clean docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@patelmohit719
patelmohit719 / jsconfig.json
Created May 13, 2021 17:06
Jsconfig file to absolute import files from src folder in react application.
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
@patelmohit719
patelmohit719 / .editorconfig
Created May 13, 2021 17:02
config file for code editor
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true
[*.md]

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database