Used initial phase | Used on daily basis | Used rarely(Advanced) |
---|---|---|
git init | git add | git clean |
git config | git commit | git blame |
git remote | git checkout | git show |
git push | git rm | |
git pull | git revert | |
git log | git reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PDF Generate Cmd: dot -Tpdf demo.gv > demo.pdf | |
# Dot Guide: https://www.graphviz.org/pdf/dotguide.pdf | |
# Examples: | |
# https://renenyffenegger.ch/notes/tools/Graphviz/examples/index | |
# | |
digraph G { | |
label = "The Title"; | |
labelloc = "top"; // place the label at the top (b seems to be default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
readme_path = r'Useful Git Commands.md' | |
skip_rules = ('# Useful Git commands', | |
'# Table of Contents:', | |
) | |
def generate_toc(headers): | |
# Syntax: [git init](#git-init) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import threading | |
import gevent | |
import gevent.monkey | |
import requests | |
gevent.monkey.patch_socket() | |
logging.basicConfig( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import time | |
import gevent | |
logging.basicConfig( | |
format='%(asctime)s - %(levelname)10s - [%(threadName)s-%(thread)d] - [%(processName)s-%(process)s]- %(message)s', | |
level=logging.DEBUG) | |
logger = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
class CommonAttributes: | |
def __init__(self): | |
self.name = 'common' | |
class MissingAttributes: | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Bottle framework demonstration | |
Below items are demonstrated here: | |
================================== | |
- Login/Logout using cookies | |
- File upload/download | |
- Hooks | |
- Plugins | |
- 404 error handling | |
- Jinja2 template usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListAddition: | |
def __init__(self, numbers): | |
self.x = numbers | |
def __add__(self, other): | |
return [self.x, other.x] | |
x = ListAddition([1, 2, 3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_lines_in_chunks(file_path: str, chunks: int = 1) -> list: | |
"""Get specified no. of lines from file | |
:param chunks: No. of lines (Default=1) | |
:param file_path: Absolute path to file | |
:return: list of lines from the file | |
""" | |
with open(file_path) as f: | |
def _get_lines(chunks): | |
return [f.readline() for _ in range(chunks)] |
NewerOlder