Skip to content

Instantly share code, notes, and snippets.

View jeromew21's full-sized avatar
🏠
Working from home

Jerome Wei jeromew21

🏠
Working from home
View GitHub Profile
@jeromew21
jeromew21 / git_frontend.py
Last active July 30, 2019 22:08
Tired of git add .; git commit -m "made some changes"; git push origin master? Are you a strong independent big brain who don't need no branches? Now you can add-commit-push in one command. Git frontend for remote repos
#!/usr/bin/python3
import os
import sys
from random import choice
if len(sys.argv) > 1 and sys.argv[1] == "show":
from subprocess import Popen, PIPE
import webbrowser
@jeromew21
jeromew21 / firefoxheadless.py
Last active March 4, 2021 19:06
[Python] Start Selenium Firefox driver in headless (invisible) mode.
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
options = Options()
options.set_headless(True)
binary = FirefoxBinary("/usr/bin/firefox") #Linux. In Windows/Mac this is different
driver = webdriver.Firefox(firefox_options=options, firefox_binary=binary)
print("started firefox in headless mode")