Skip to content

Instantly share code, notes, and snippets.

View sergio-bershadsky's full-sized avatar
🦄
Optimizing Reality

Sergey Bershadsky sergio-bershadsky

🦄
Optimizing Reality
View GitHub Profile
@sergio-bershadsky
sergio-bershadsky / generic_selenium_waiter.py
Last active August 19, 2020 05:35
Selenium list waiter
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
def ready_state_complete(driver):
state = driver.execute_script("return document.readyState")
if state == "complete":
return True
return False
#!/usr/bin/env python3
import pstats
import cProfile
import functools
class ProfileIt(object):
def __call__(self, f):
@sergio-bershadsky
sergio-bershadsky / freeze.sh
Last active July 9, 2018 11:34
Docker based python freezer
#!/usr/bin/env bash
# Note:
# requirements.pip file must be inside current directory
#
# Use: freeze.sh [version:3.6]
#
# Example:
# > freeze.sh
# > freeze.sh 3.4
@sergio-bershadsky
sergio-bershadsky / pull.py
Created October 30, 2014 10:00
Simple script to track changes in repository
import os
import subprocess
DIR = os.path.dirname(os.path.abspath(__file__))
PYTHON = os.path.normpath(os.path.join(DIR, '../', 'env', 'bin', 'python'))
UPDATE_SCRIPT = os.path.normpath(os.path.join(DIR, 'update.py'))
GIT_HEAD = ['git', 'rev-list', 'HEAD', '--count']
GIT_PULL = ['git', 'pull']