Skip to content

Instantly share code, notes, and snippets.

View pradishb's full-sized avatar

Pradish Bijukchhe pradishb

View GitHub Profile
@pradishb
pradishb / .gitignore
Last active August 19, 2020 04:46
Python gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@pradishb
pradishb / clone.bat
Created November 24, 2019 14:06
VMware Workstation tool to clone, run and set environment variables in a batch
@echo off
set vmrun=C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe
set mothervm=C:\Users\Pradish\Documents\Virtual Machines\Windows 7 x64\Windows 7 x64.vmx
set workerdirectory=C:\workers
set start=1
set end=10
set guestusername=Administrator
set guestpassword=ease
echo All bots will be cloned again and existing data in %workerdirectory% will be wiped. Are you sure?
@pradishb
pradishb / gimp_get_selection_rectangle.py
Last active September 25, 2020 18:53
Gimp python plugin to copy rectangle (x, y, w, h) to clipboard
#!/usr/bin/env python
import os
import platform
import subprocess
from gimpfu import *
def get_rectangle(image):
selection, x_1, y_1, x_2, y_2 = pdb.gimp_selection_bounds(image)
@pradishb
pradishb / set-resolution-vmware-lubuntu.sh
Created April 1, 2020 08:00
Sets the resolution to 1920x1080 in lubuntu vmware
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080_60.00
xrandr --output Virtual1 --mode 1920x1080_60.00
@pradishb
pradishb / python-snippets
Last active February 5, 2021 13:37
My custom python snippets for VSCode. Includes (main, unittest, cv2.imshow)
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
{
"editor.formatOnSave": true,
"python.formatting.autopep8Args": ["--max-line-length=99"],
"python.sortImports.args": [
"--sl",
"--src=${workspaceFolder}"
],
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
@pradishb
pradishb / tasks.json
Created September 11, 2020 17:25
vscode-autoflake-remove-all-unused-imports-task
{
"version": "2.0.0",
"tasks": [
{
"label": "autoflake-remove-all-unused-imports",
"type": "shell",
"command": "${config:python.pythonPath}",
"args": [
"-m",
"autoflake",
@pradishb
pradishb / freeze.bat
Created November 11, 2020 05:35
Windows batch script to generate requirements.txt without pylint and autopep8
@echo off
echo Generating requirements.txt...
pip freeze | ^
find /V "six" | ^
find /V "astroid" | ^
find /V "autopep8" | ^
find /V "colorama" | ^
find /V "isort" | ^
find /V "lazy" | ^
find /V "mccabe" | ^
@pradishb
pradishb / catalog.json
Last active November 26, 2023 03:37
League of Legends Skin Catalog
[
{
"active": true,
"bundled": null,
"iconUrl": "championsskin_10002.jpg",
"inactiveDate": null,
"inventoryType": "CHAMPION_SKIN",
"itemId": 10002,
"itemInstanceId": "7c6a2fb9-90eb-4b94-b6ab-b5cc9efebd5f",
"itemRequirements": [
@pradishb
pradishb / logger.py
Last active November 1, 2023 16:23
Logger conifuration with StreamHandler and RotatingFileHandler
import logging
import os
import sys
from logging import Formatter
from logging import LogRecord
from logging import StreamHandler
from logging.handlers import RotatingFileHandler
class ColorFormatter(logging.Formatter):