Skip to content

Instantly share code, notes, and snippets.

@frankfarmer
frankfarmer / fastlyMonthToDateBill.py
Last active January 18, 2023 20:53 — forked from achton/fastlyMonthToDateBill.py
Calculate your month-to-date bill from Fastly with the billing API
#!/usr/bin/env python3
# Requires Python 3
import requests
import locale
from typing import Dict, Tuple, List
from calendar import monthrange
from datetime import datetime

Keybase proof

I hereby claim:

  • I am frankfarmer on github.
  • I am frankfarmer (https://keybase.io/frankfarmer) on keybase.
  • I have a public key whose fingerprint is E85B F323 C0AF E9AA 1096 00EB BD0E A7A4 A448 75CE

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am frankfarmer on github.
  • I am frankfarmer (https://keybase.io/frankfarmer) on keybase.
  • I have a public key whose fingerprint is E85B F323 C0AF E9AA 1096 00EB BD0E A7A4 A448 75CE

To claim this, I am signing this object:

function getTzMap() {
/**
* Nice, succinct yet complete timezone list, ported from
* http://www.unicode.org/cldr/data/docs/design/formatting/zone_log.html#windows_ids
*/
return array(
'-12' => array(
'(STD) International Date Line West' => 'Etc/GMT+12'
),
-- Write a script that takes the following mysql data,
-- and imports it into a normalized, indexed postgres database.
CREATE TABLE `polls` (
`user_name` text NOT NULL,
`poll_question` text NOT NULL,
`poll_option_1` text NOT NULL,
`poll_option_2` text NOT NULL,
`poll_option_3` text NOT NULL,
/*
+ Write an application that parses strings formatted like the below into a tree structure.
+ Format:
1. Top level nodes are not indented. There may be more than one top level node.
2. If the current line is indented one tab deeper than the previous line, it is a child of the previous node.
3. The indentation level of a line may never be more than 1 tab deeper than the previous line
*/
$tree = <<<QQ
Gardening Tools