Skip to content

Instantly share code, notes, and snippets.

View YatinAdityaT's full-sized avatar

Sabito YatinAdityaT

View GitHub Profile
YatinAdityaT /
Created June 11, 2021 11:22
Remove all comments from a .py file
# use python -f <filename>
# not meant to be very smart (can't distinguish "a = "#test"" for example...)
import os
import argparse
import re
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', type=str)
args = parser.parse_args()

Keybase proof

I hereby claim:

  • I am yatinadityat on github.
  • I am yatin_so ( on keybase.
  • I have a public key ASCyPknqEcCXoEV2W0_PewP7ziMSNrSc8zBF3srWGxCNFAo

To claim this, I am signing this object:

YatinAdityaT /
Created July 21, 2020 02:03 — forked from thorsummoner/
python multiprocessing example
#!/usr/bin/env python3
""" Example multiprocess based python file
import multiprocessing
import argparse
import itertools
ARGP = argparse.ArgumentParser(
YatinAdityaT /
Last active August 2, 2020 03:48
Cool things people over at Stack Overflow say

"should realistically not play any role at all." And this is the disconnect: people have this annoying habit of acting like… well, humans. Messy, squishy, organic, fallible wetware that is exceptionally prone to both acting and reacting based on a combination of both emotion and rational thought with a highly variable balance, even with the same individual, depending on a wide (and wild) variety of factors. StackOverflow's largest collective sin is, in fact, not expecting humans to act like humans.

Hi, Andy. It is my hope that this message finds you in good health and better cheer! I'm waiting out a rainstorm here, the sort of fast and heavy summer rains common to the southern parts of Colorado - you may be familiar with them. But enough of these matters: I write to you today for a singular purpose, that of expressing my disagreement with your reasoning in the above answer. While I can certainly appreciate the desire for familiarity among peers on SO, ultimately I feel it serves only to distract casual r

YatinAdityaT / socp
Last active May 13, 2021 08:01 — forked from jforberg/socp
Stack Overflow copy pasta
MSE answer for common terms used:
Canonical answer for python files with same names as import files:
value = 40
start_time = time.time()
readings = []
offset = 28876
x_offset = 0
starttime = time.time()
YatinAdityaT /
Created June 20, 2020 07:12
selenium dino game
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import StaleElementReferenceException
driver = webdriver.Firefox(executable_path=r'D:\Installers\geckodriver.exe') # path of your geckodriver and change firefox to Chrome....
canvas = driver.find_element_by_css_selector('.runner-canvas')
if cv2.waitKey() == ord('q'):
PATH = 'Real Life Violence Dataset/Violence/V_10.mp4'
cap = cv2.VideoCapture(PATH)
fps = cap.get(cv2.CAP_PROP_FPS)
frame_count = cap.get(cv2.CAP_PROP_FRAME_COUNT)
duration = frame_count / fps
mid_point = frame_count//2
starting_point = mid_point-20
time_stamp = starting_point/fps
cap.set(cv2.CAP_PROP_POS_MSEC, time_stamp * 1000)