Skip to content

Instantly share code, notes, and snippets.

View brandon-rhodes's full-sized avatar

Brandon Rhodes brandon-rhodes

View GitHub Profile
@lrhache
lrhache / python-selenium-open-tab.md
Last active July 31, 2024 20:57
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@brandon-rhodes
brandon-rhodes / build-overlay.py
Last active April 26, 2024 13:44
Script that builds a Google Earth overlay that projects the map of Tolkien’s Middle-earth atop modern Europe at the correct position and scale. Once the .kmz overlay file has been generated, simple open it using the File menu in Google Earth.
"""Project a map of Middle-earth on modern Europe.
Builds an `overlay.kmz` file in the current directory which should be
opened with Google Earth.
"""
import os
import urllib2
import zipfile
from math import cos, radians