Skip to content

Instantly share code, notes, and snippets.

View SureshKL's full-sized avatar

Suresh K L SureshKL

  • Sony India Software Centre Private Limited
  • Bangalore
View GitHub Profile
@SureshKL
SureshKL / gevent_asynchronous_demo.py
Last active January 23, 2019 11:57
Python: gevent - synchronous/asynchronous execution
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__)
@SureshKL
SureshKL / concurrent_download.py
Created January 23, 2019 11:55
Python - Single vs Multithreaded download using threading and gevent
import logging
import threading
import gevent
import gevent.monkey
import requests
gevent.monkey.patch_socket()
logging.basicConfig(
@SureshKL
SureshKL / git_commands.md
Last active March 19, 2019 16:35
Useful Git Commands
@SureshKL
SureshKL / git_commands_toc_generator.py
Created March 19, 2019 16:37
[Utility] Git commands TOC Generator
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)
@SureshKL
SureshKL / demo.gv
Last active March 22, 2019 10:31
Dot Template
# 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)