Skip to content

Instantly share code, notes, and snippets.

View Mizzlr's full-sized avatar

Mushtaque Ahamed A Mizzlr

View GitHub Profile
# from selenium import webdriver
from seleniumwire import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.options import Options
import time
import os
import calendar
import traceback
import json
@Mizzlr
Mizzlr / list-all-github-repos-in-an-org.py
Created October 27, 2020 22:38
list-all-github-repos-in-an-org.py
from github import Github
g = Github('your-github-login', 'your-github-token-XXXX')
if __name__ == '__main__':
for repo in g.get_user().get_repos():
print(repo.name)
@Mizzlr
Mizzlr / indian-tax-deduction-on-salary-tds.py
Created August 25, 2019 14:15
This script print tax deduction for various amounts of salary as india's income tax rules.Source https://www.paisabazaar.com/tax/tds-on-salary/
import tabulate
def calc_indian_tds(salary):
if salary < 2.5e5:
tds = 0
elif salary < 5e5:
tds = salary * 0.05
elif salary < 1e6:
tds = (salary - 5e5) * 0.20 + 5e5 * 0.05
"""This module provides tools to clone github repos. The GithubOrgCloner
can clone an entire org worth of codebases and create a local corpus of projects.
"""
import git
import shutil
import traceback
import urllib.parse
from argparse import ArgumentParser
from functools import partial
#!/bin/bash
# Dependencies:
# ripgrep https://github.com/BurntSushi/ripgrep#installation
# realpath from GNU coreutils
# pip3 install pylint isort dewildcard
# Usage: ./fix-python-wild-card-imports.sh "path/to/python/source/to/fix/"
# set -x # uncomment this line to see all commands
@Mizzlr
Mizzlr / zipf.py
Created October 11, 2018 09:19
Work frequency in a python codebase.
import tokenize, collections, pathlib, pprint
counter = collections.Counter()
source_path = pathlib.Path('.')
for filename in source_path.glob('**/*.py'):
print(f'Scanning tokens {filename} ...')
tokens = tokenize.tokenize(open(filename, 'rb').__next__)
for token in tokens:
if token.type == 1 or token.type == '3' and ' ' not in token.string:
@Mizzlr
Mizzlr / convert.py
Created October 11, 2018 06:02
Convert a given camel case python codebase into snake case.
import stringcase, tokenize, pathlib, tqdm, os
os.system("mkdir -p converted/src/")
os.system("rm -rf converted/src/*")
os.system("cp -r src/* converted/src/")
IGNORE = {'dictConfig', 'Box'}
keywords = set()
source_path = pathlib.Path('converted/src/')
@Mizzlr
Mizzlr / VariableType.h
Created June 9, 2018 17:19
torch/csrc/autograd/generated/VariableType.h for use in https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic.py
#pragma once
// @generated from tools/autograd/templates/VariableType.h
#include <ATen/ATen.h>
#include <cstdint> // for size_t
#include <functional> // for function
#include <memory> // for unique_ptr
#include <string>
clear ; close all; clc
% Specify the architecture
input_layer_size = 900; % 30x30 Input Images of Digits
hidden_layer_size = 300; % 300 hidden units
num_labels = 92;
% set maximum number of training iteration as you please
% larger MaxIter results in better accuracy
options = optimset('MaxIter', 10);
lambda = 1; % learning rate for regularization
function [J ,grad] = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda)
Theta1 = reshape(nn_params(1:hidden_layer_size * ...
(input_layer_size + 1)), ...
hidden_layer_size, (input_layer_size + 1));