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 itertools | |
import random | |
# Define the team names, divisions, positions from the previous year, and designated rivals | |
teams = [ | |
{"name": "Team A", "division": 1, "position": 1, "rival": "Team B"}, | |
{"name": "Team B", "division": 1, "position": 2, "rival": "Team A"}, | |
{"name": "Team C", "division": 1, "position": 3, "rival": "Team D"}, | |
{"name": "Team D", "division": 1, "position": 4, "rival": "Team C"}, | |
{"name": "Team E", "division": 2, "position": 1, "rival": "Team F"}, |
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 requests | |
from urllib.parse import urlencode | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials | |
# Define your API credentials | |
client_id = "YOUR_CLIENT_ID" | |
client_secret = "YOUR_CLIENT_SECRET" | |
redirect_uri = "YOUR_REDIRECT_URI" # You set this when registering your app | |
access_token = None |
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
def list_available_params(self): | |
"""Iterates over Odin query methods and creates a list of available queries for a | |
client. Any methods added to this class will be included in this response if they | |
are prefaced with "_get_". | |
Returns: | |
list -- list of strings corresponding to methods on this class that are prefaced | |
with "_get_", excluding "_get_odin_info" | |
""" | |
method_list = [ |
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
def _send_message(bot, message_to_send): | |
attachments = _format_attachments(bot, message_to_send) | |
print(attachments) | |
response = requests.post( | |
f"{GROUPME_URL}/bots/post", | |
params={"token": GROUPME_TOKEN}, | |
data = { | |
"bot_id": bot.get("bot_id"), | |
"text": message_to_send, | |
"attachments": attachments |
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
#!/bin/sh | |
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches. | |
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below. | |
# Install in current Git repo: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh | |
# Install with core.whitespace check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2 | |
# Install with core.whitespace check and EOF-newline-check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3 | |
# Install only core.whitespace check: |