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 os | |
import yaml | |
import logging.config | |
import logging | |
import coloredlogs | |
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'): | |
""" | |
| **@author:** Prathyush SP | |
| Logging Setup |
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
This gist reveals language snippets |
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
# %% [markdown] | |
# RMV Appointment Finder v1.0 | |
# %% | |
# Install Required Libraries | |
# !python3 -m pip install selenium pandas tqdm webdriver-manager -q | |
# | |
# Execution: | |
# python3 us_rmv_appointment_finder.py | |
# |
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
""" | |
Requirements | |
1. Numpy | |
2. Pympler or a recursive sys.getsizeof() | |
3. PIL | |
""" | |
import numpy as np | |
from pympler.asizeof import asizeof | |
import json |
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
// Run below code in respective window console | |
window.addEventListener("focus", e => document.getElementsByClassName("split-menu-button")[0].click()); |
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
#!/usr/bin/env bash | |
# Install Open MPI v4 | |
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.0.tar.gz | |
tar -xvf openmpi-4.0.0.tar.gz | |
cd openmpi-4.0.0 | |
./configure --prefix=/usr/local | |
make all | |
sudo make install | |
sudo ldconfig |
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 humanize_time_delta(td_object): | |
seconds = td_object | |
periods = [ | |
('year', 60 * 60 * 24 * 365), | |
('month', 60 * 60 * 24 * 30), | |
('day', 60 * 60 * 24), | |
('hour', 60 * 60), | |
('minute', 60), | |
('second', 1), | |
('milli_second', 1 / 10 ** 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
# -*- coding: utf-8 -*- | |
""" | |
| **@created on:** 18/07/18, | |
| **@author:** prathyushsp, | |
| **@version:** v0.0.1 | |
| | |
| **Description:** | |
| | |
| | |
| **Sphinx Documentation Status:** -- |
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 traceback | |
import sys | |
# Context manager that copies stdout and any exceptions to a log file | |
class Tee(object): | |
def __init__(self, filename): | |
self.file = open(filename, 'w') | |
self.stdout = sys.stdout | |
def __enter__(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
#!/bin/bash | |
# Convert bash aliases to bash scripts. | |
# | |
# Copyright 2018 <hoijui.quaero@gmail.com>, licensed under the GPL-3.0+ | |
# | |
# Usage: | |
# convert_bash_aliases_to_scripts # converts all bash aliases to script files | |
# convert_bash_aliases_to_scripts clean # removes all scripts previously converted by this script | |
COLOR_RED=$'\e[0;31m' |
NewerOlder