Skip to content

Instantly share code, notes, and snippets.

View rybesh's full-sized avatar

Ryan Shaw rybesh

View GitHub Profile
import datetime
import math
import mercantile
import pytz
import suncalc
def date(yyyy, mm, dd, hh):
dt_naive = datetime.datetime(yyyy, mm, dd, int(hh), int((60 * hh) % 60))
dt_local = dt_naive.astimezone(pytz.timezone('America/Los_Angeles'))
dt_utc = dt_local.astimezone(pytz.utc)
@ptgolden
ptgolden / crawl_w3_list.py
Last active November 24, 2015 16:12
Python script to crawl a W3 mailing list and add it to an mbox file.
#!/usr/bin/python3
import html
import mailbox
import re
import sys
import time
from urllib.parse import urljoin
import requests

Star this Gist to indicate preference for the flatter form (no "when", no "type", no new GeoJSON items, JSON-LD required) of GeoJSON-LD time (see geojson/geojson-ld#13).