/images/avatar.png

Hi! I'm Pratyaksha.

Solid Design Principles

SOLID is a set design principles in object-oriented context to make maintainable, testable and extendable software. Single Responsibility A class should only have one responsibility. Furthermore, it should only have one reason to change. Benefits: Testing: A class with one responsibility will have far fewer test cases. Lower coupling: Less functionality in a single class will have fewer dependencies. Organization: Smaller, well-organized classes are easier to search than monolithic ones. Example Bad A class representing a book:

Selenium Cheat Sheet

Info This post assumes prior knowledge of python and selenium 4 Installation Selenium: pip install selenium Download the drivers, make sure that your browser, selenium and driver versions are compatible with each other. Chrome: https://chromedriver.chromium.org/downloads Firefox: https://github.com/mozilla/geckodriver/releases Edge: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Instantiate your driver Chrome 1 2 from selenium import webdriver driver = webdriver.Chrome(executable_path="C:/webdrivers/chromedriver.exe") With custom options 1 2 3 4 5 6 7 from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() ## option to not show an open browser window options.

Git Cheat Sheet

Setup User name: git config --global user.name "[firstname lastname]" Email: git config --global user.email "[valid-email]" Color: git config --global color.ui auto Initialization and cloning Make your current folder a git repo: git init Clone a repo: git clone [url] Staging and commits Get status of staged, unstages and untracked files: git status Add files to staging: git add [file] Remove a file from staging: git reset [file] Remove a file from staging and remove all changes: git reset --hard [file] Differences in files that are modified but not staged: git diff Differences in files that are staged but not committed: git diff --staged Commit changes: git commit -m "[message]" Commit only specific portion of a file: git add -p [file] Note: Git will go into interactive mode and prompt options for actions on each hunk.