Skip to content

Instantly share code, notes, and snippets.

I want to believe.

Josh Geller joshgeller

I want to believe.
View GitHub Profile
joshgeller / cities.json
Last active Aug 25, 2020 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates and Timezone, in JSON
View cities.json
"city": "New York",
"growth_from_2000_to_2013": "4.80%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": 8405837,
"rank": 1,
"state": "New York",
"timezone": "America/New_York"
joshgeller /
Created May 2, 2018
Convert local date to midnight UTC timestamp
import pytz
from datetime import date, datetime, time
def today_to_midnight_utc(local_tz='UTC'):
Returns today's date (local timezone) as a midnight UTC timestamp.
e.g. If date is 04/20/18, and server timezone is America/Los_Angeles:
>> 1524182400
joshgeller /
Last active Aug 29, 2015
Add contents of specified columns in .csv file to a list of dictionaries
import csv
def import_csv(filename=None, import_all_columns=False, columns_to_import=None, remove_duplicates=False):
Add contents of specified columns in .csv file to a list of dictionaries.
:param filename: string
:param import_all_columns: bool
:param columns_to_import: list
You can’t perform that action at this time.