This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| date = "2018-08-30" | |
| year, month, day = date.split('-') | |
| utc = pytz.utc | |
| eastern = timezone('US/Eastern') | |
| # fmt = '%Y-%m-%d %H:%M:%S %Z%z' # returns 2018-08-29 20:00:00 EDT-0400 | |
| fmt = '%Y-%m-%dT%H:%M:%SZ' | |
| utc_dt = datetime(year=int(year), month=int(month), day=int(day), hour=0, minute=0, second=0, tzinfo=utc) | |
| loc_dt = utc_dt.astimezone(eastern) | |
| start_date = loc_dt.strftime(fmt) #2018-08-29T20:00:00Z | |
| utc_dt = datetime(year=int(year), month=int(month), day=int(day), hour=23, minute=59, second=59, tzinfo=utc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ISO3166_3to2 = { | |
| 'AFG': 'AF', | |
| 'ALA': 'AX', | |
| 'ALB': 'AL', | |
| 'DZA': 'DZ', | |
| 'ASM': 'AS', | |
| 'AND': 'AD', | |
| 'AGO': 'AO', | |
| 'AIA': 'AI', | |
| 'ATA': 'AQ', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import uuid | |
| import requests | |
| import jwt | |
| import datetime | |
| def get_jwt_token(client_id, secret): | |
| millis = datetime.datetime.utcnow() | |
| plus10min = millis + datetime.timedelta(minutes=10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo mdutil -E / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.List; | |
| import java.util.Map; | |
| import com.google.gson.Gson; | |
| import com.google.gson.reflect.TypeToken; | |
| import javax.ws.rs.core.GenericType; | |
| public class JsonGsonToListOrMap { | |
| public static void main(String[] args) { |