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 shutil | |
| import tempfile | |
| import time | |
| from pathlib import Path | |
| import requests | |
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options |
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
| SELECT | |
| user_name, | |
| warehouse_name, | |
| warehouse_size, | |
| database_name, | |
| run_date, | |
| ROUND(t/1000/3600*credits_per_hour, 2) credits | |
| FROM ( | |
| SELECT |
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 boto3 | |
| def clone_iam_role(original_role_name, | |
| new_role_name): | |
| iam = boto3.client("iam") |
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 boto3 | |
| original_instance_profile_name = 'original-role' | |
| new_instance_profile_name = 'new-role' | |
| def clone_instance_profile(original_instance_profile_name, | |
| new_instance_profile_name): |
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
| https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains | |
| https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract | |
| https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_replace |
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 copy | |
| def merge_dict_deep(dest, src): | |
| merged_dict = copy.deepcopy(dest) | |
| for key in src: | |
| if key not in dest: | |
| merged_dict[key] = src[key] | |
| elif isinstance(dest[key], dict) and isinstance(src[key], dict): |
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 boto3.session import Session | |
| import base64 | |
| from botocore.exceptions import ClientError | |
| def get_secret(secret_name, region_name='us-west-2'): | |
| secret_value_response = {} | |
| try: | |
| secret_value_response = ( |
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
| function newlineDelimitedKeyValue(obj, parentKey = '') { | |
| return Object.entries(obj) | |
| .map(([k, v]) => { | |
| if (typeof v === 'object') { | |
| return newlineDelimitedKeyValue(v, `${parentKey}${k}_`); | |
| } | |
| const kUpper = `${parentKey}${k}`.toUpperCase(); | |
| return `${kUpper}=${v}`; |
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
| # https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html | |
| # Validate the project is correct and all necessary information is available. | |
| validate: | |
| mvn validate | |
| # Compile the source code of the project. | |
| compile: | |
| mvn compile | |
| # Test the compiled source code using a suitable unit testing framework. |
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 | |
| from boto3.session import Session | |
| session = Session() | |
| for region_name in session.get_available_regions('secretsmanager'): | |
| endpoint_url = f'https://secretsmanager.{region_name}.amazonaws.com' |
NewerOlder