This file contains 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
theCats = {} | |
for i in range(1,101): | |
theCats[i] = False | |
for i in range(1,101): | |
for cats, hats in theCats.iteritems(): | |
if cats % i == 0: | |
if theCats[cats] == True: | |
theCats[cats] = False |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am zevav on github. | |
* I am zevav (https://keybase.io/zevav) on keybase. | |
* I have a public key whose fingerprint is 96F2 1B88 D92A E682 AD9D FD59 50EB C01D 3390 FFDD | |
To claim this, I am signing this object: |
This file contains 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
from selenium import webdriver | |
import time | |
from selenium.webdriver.common.keys import Keys | |
from config import username, password | |
"""This downloads *all* the .json transcripts from your Speechmatics account. Why didn't I use the API? The docs are down, so voila.""" | |
fp = webdriver.FirefoxProfile() | |
fp.set_preference("browser.download.folderList",2) | |
fp.set_preference("browser.download.manager.showWhenStarting", False) |
This file contains 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
# coding: utf-8 | |
import os | |
class Converter: | |
"""Converts Ghost markdown files to Lektor markdown.""" | |
def __init__(self, from_dir, to_dir, author): | |
self.from_dir = from_dir | |
self.to_dir = to_dir | |
self.author = author |
This file contains 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
#!/usr/bin/env python3 | |
""" | |
This requires a _config.py file containing a dictionary called config. | |
There should be a dictionary in config for each meetup group, the key | |
being a shorthand title for the meetup group's name, and the values | |
dicts with key 'meetup_name' and 'meetup_api_key' with corresponding | |
values for those. | |
eg.: config = {'my_cool_meetup': | |
{'meetup_name': <the value after the '/' in your meetup URL>, |
This file contains 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
from datetime import date | |
from email import encoders | |
from email.mime.application import MIMEApplication | |
from email.mime.base import MIMEBase | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import smtplib | |
from time import sleep | |
FROM_EMAIL = 'put your from email here (can be same as MAIL_USERNAME)' |
This file contains 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 pygsheets | |
def get_value_of_named_range_from_google_sheet(sheet_name: str, worksheet_title: str, range_name: str) -> str: | |
"""return the value of the first cell from a named range | |
great for treating Google Sheets NamedRanges as variables in Python scripts""" | |
# https://pygsheets.readthedocs.io/en/latest/authorizing.html | |
gc = pygsheets.authorize(outh_file='client_secret.json', outh_nonlocal=True) | |
sh = gc.open(sheet_name) |
This file contains 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
# http://greatdata.com/areacodetimezone | |
area_code_gmt_dict = { | |
201: -5, | |
202: -5, | |
203: -5, | |
205: -6, | |
206: -8, | |
207: -5, | |
208: -7, |
This file contains 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
""" | |
The star of this show is get_tenders, which will return all tenders | |
if there are no keyword arguments supplied, or tenders from a specific location, | |
and/or before/after datetimes. | |
For convenience, here are the fields of a Tender: | |
'id' | |
'location_id' | |
'transaction_id' |
This file contains 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
from time import sleep | |
BOARD_WIDTH = 17 | |
LEFT_PAD_30 = " " * 30 | |
LEFT_PAD_10 = " " * 10 | |
WIN_BOXES = [(0, 1, 2), | |
(3, 4, 5), | |
(6, 7, 8), | |
(0, 3, 6), | |
(1, 4, 7), |
OlderNewer