Posts

PIP -- Help Guide

Get the version and details of the installed package  pip show django the sample output  Name: Django Version: 3.1.5 Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design. Home-page: https://www.djangoproject.com/ Author: Django Software Foundation Author-email: foundation@djangoproject.com License: BSD-3-Clause Location: c:\python\lib\site-packages Requires: asgiref, pytz, sqlparse Required-by: django-appconf, django-celery-email, django-haystack

Development Test Emails

 https://github.com/ChangemakerStudios/Papercut-SMTP

Useful Git Terminal Commands

Delete git local branch https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/ Switch branch using git checkout git checkout <existing_branch_name> if the branch does not exist, -b option will create a new branch for the same. git checkout -b <new_branch-name> Git pull till a particular commit git pull is nothing but git fetch followed by git merge . So what you can do is git fetch remote example_branch git merge <commit_hash> https://stackoverflow.com/questions/31462683/git-pull-till-a-particular-commit/48728993 https://www.freecodecamp.org/news/git-checkout-remote-branch-tutorial/

Regular Expression |R

Regular Expressio '\s' : To accept the single white space. eg: To accept the space along with text need to use. ([a-z]+\s)+ var validate_pattern_azdotspace = "([a-z]+[ \\ . \\ s]?)*[a-z]+" ; if you are using this with Validate.js lib. consider of adding additional backslash with '\s' Eg: '\\s'. Use Case: Alphanumeric with space and dot. The expression must contain an alphabet. '(?=.*[a-z])([a-z0-9]+[\\.\\s]?)*[a-z0-9]+[\\s]?' Different blocks in expression (?=.*[a-z]) ([a-z0-9]+[\\.\\s]?)* [a-z0-9]+[\\s]? Block 1 Note: if regex is used in javascript, need to add an escape character  eg : "\s" for single white space, it can be represented in javascript " \\s " the text should not contain an only numbers, it can accept numbers in between

Change indentation in Visual Studio Code (VS Code) |R

Image
Click on the right bottom Spaces option  It will show different spacing options available with visual studio code. Select "Indent using tabs" it will show the different spacing configuration for tab indent select one value and the file tab indent will be updated with the selected value https://stackoverflow.com/questions/34174207/how-to-change-indentation-in-visual-studio-code

MySQL Database Backup Using CLI

 Backup MySQL using terminal mysqldump -u [user name] –p [password] [options] [database_name]  > [dumpfilename.sql] mysqldump -v -u appuser–p  mydb > mydbbackup.sql

Print Date and Time in windows command line without prompt

 Date To print the date in the windows command-line/console. date /T The /T parameter will omit the prompt for a new date. Example: C:\>date /T 21-06-2021 If the user wants to set a new date, use the following command  in command-line date Time To print the time in the windows command-line/console time /T The /T parameter will omit the prompt for a new time. Example C:\>time /T 17:36 if the user wants to set a new time, use the following command in command-line time