Skip to content

Instantly share code, notes, and snippets.

View musleh0001's full-sized avatar
🎯
Focusing

Md Musleh Uddin musleh0001

🎯
Focusing
  • W3 Engineers Ltd.
  • Dhaka, Bangladesh
  • 16:58 (UTC +06:00)
  • X @musleh_x_khan
View GitHub Profile
@musleh0001
musleh0001 / vim.md
Last active July 21, 2022 17:35
vim command

*********** Vim Config **********

call plug#begin('~/.vim/plugged')

Plug 'tomasiser/vim-code-dark'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/nerdtree'
Plug 'morhetz/gruvbox'
Plug 'leafgarland/typescript-vim'
@musleh0001
musleh0001 / decorators.py
Created February 28, 2022 07:39
Decorator Example
from functools import wraps
def my_logger(orig_func):
import logging
logging.basicConfig(
filename="{}.log".format(orig_func.__name__), level=logging.INFO
)
@wraps(orig_func)
@musleh0001
musleh0001 / generators.py
Created February 28, 2022 06:13
Generator Memory Efficient
import memory_profiler as mem_profile
import random
import time
names = ["John", "Corey", "Adam", "Steve", "Rick", "Thomas"]
majors = ["Math", "Engineering", "CompSci", "Arts", "Business"]
print(f"Memory (Before): {mem_profile.memory_usage()}Mb")
@musleh0001
musleh0001 / main.py
Created February 27, 2022 06:48
Different ways of checking if a number is EVEN or ODD
num1 = 13
num2 = 16
# Tuple
print(("Odd", "Even")[num1 % 2 == 0])
print(("Odd", "Even")[num2 % 2 == 0])
# Dict
print({True: "Even", False: "Odd"}[num1 % 2 == 0])
print({True: "Even", False: "Odd"}[num2 % 2 == 0])

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database