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 { myConst, Robot, Direction } from "."; | |
describe("Pairing test", () => { | |
it("runs", () => { | |
expect(myConst).toBe(true); | |
}); | |
}); | |
describe("basic robot movement", () => { | |
it("moves in each direction successfully", () => { |
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
locals { | |
tables = {for idx, val in fileset(path.module, "./models/**/*.json"): | |
"${jsondecode(file("./${val}")).dataset}.${jsondecode(file("./${val}")).tableName}" => jsondecode(file("./${val}")) } | |
# Creates a map, keys are "dataset.table", values are decoded json. | |
# Will be unique per project | |
} | |
resource google_bigquery_table tables { | |
for_each = local.tables | |
depends_on = [ |
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
{ | |
"$id": "file://json_schema/table_definition.schema.json", | |
"type": "object", | |
"properties": { | |
"tableName": { | |
"type": "string", | |
"minLength": 1, | |
"maxLength": 300, | |
"pattern": "^[a-zA-Z_](?:[a-zA-Z0-9_])*$" | |
}, |
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
{ | |
"$schema": "../../json_schemas/table_definition.schema.json", | |
"tableName": "billedusage", | |
"tableType": "transactional fact", | |
"dataset": "sid_common", | |
"description": "Total bill for per customer per month", | |
"labels": {}, | |
"clusteringColumns": [], | |
"columns": [ | |
{ |
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
def create_music_round(): | |
prs.slides.add_slide(slide_layouts.get_by_name("MUSIC_ROUND_INTRO")) | |
def create_song_obj_from_folder(folder): | |
try: | |
question = next(file_path for file_path in listdir(path.join("questions", "songs", folder)) if re.match("^question\.(mp3|m4a)$", file_path)) | |
answer = question | |
try: | |
answer = next(file_path for file_path in listdir(path.join("questions", "songs", folder)) if re.match("^answer\.(mp3|m4a)$", file_path)) | |
except: |
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
ROUNDS = [name.upper() for name in book.sheetnames if name != "Wipeout"] | |
def create_rounds_preview(): | |
rounds_slide = prs.slides.add_slide(slide_layouts.get_by_name("ROUNDS")) | |
Q1_idx, Q2_idx, Q3_idx, Q4_idx, Q5_idx, Q6_idx = 10, 11, 12, 13, 14, 15 # defined when creating the objects, can't change these easily | |
rounds_slide.placeholders[Q1_idx].text = f"1. {ROUNDS[0]} - 10 QUESTIONS" | |
rounds_slide.placeholders[Q2_idx].text = f"2. {ROUNDS[1]} - 10 QUESTIONS" | |
rounds_slide.placeholders[Q3_idx].text = f"3. {ROUNDS[2]} - 10 QUESTIONS" | |
rounds_slide.placeholders[Q4_idx].text = f"4. PICTURE ROUND - 9 QUESTIONS" |
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
def create_worded_round(round_number): | |
round_name = ROUNDS[round_number - 1] | |
questions = [ | |
{"question": pair[0].value, "answer": pair[1].value} | |
for pair in book.worksheets[round_number - 1]['A2':'B11'] | |
if pair[0].value is not None and pair[1].value is not None | |
] | |
assert len(questions) == 10, f"Round {round_number} called {round_name} does not have 10 questions" | |
round_intro_slide = prs.slides.add_slide(slide_layouts.get_by_name("ROUND_ANNOUNCEMENT")) | |
round_intro_slide.placeholders[10].text = f"{round_name} ROUND" |
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
// imports etc... | |
book = load_workbook(path.join("questions", "questions.xlsx"), read_only=True) | |
// ready to read out excel content | |
prs = Presentation("template.pptx") | |
slide_layouts = prs.slide_master.slide_layouts | |
// implementation functions... |
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
from datetime import datetime, timedelta | |
from airflow import models | |
from airflow.contrib.operators.bigquery_operator import BigQueryOperator | |
from airflow.operators.tableau_plugin import RefreshDatasourceOperator | |
default_dag_args = { | |
'start_date': datetime(2021, 4, 5), | |
'owner': 'Mark McCracken', | |
'retries': 1, | |
'retry_delay': timedelta(minutes=5), |
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
from airflow.operators import BaseOperator | |
from os import environ | |
from time import sleep | |
import requests | |
import xml.etree.ElementTree as ET | |
class RefreshDatasourceOperator(BaseOperator): | |
auth_token = None | |
site_id = None |
NewerOlder