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
# You can run this script to generate the SQL files for the models and fetch columns names from Databricks. | |
# Run it on the command line, like this: | |
# python utils/generate_models.py \ | |
# -yml models/staging/salesforce/_source_salesforce.yml \ | |
# -o models/staging/salesforce | |
# Or see all options with python utils/generate_models.py --help | |
import yaml | |
import os | |
import requests |
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 requests, json, ipaddress | |
def get_cidr_ranges(provider): | |
if provider == 'aws': | |
url = 'https://ip-ranges.amazonaws.com/ip-ranges.json' | |
base_key = 'prefixes' | |
key = 'ip_prefix' | |
elif provider == 'gcp': | |
url = 'https://www.gstatic.com/ipranges/cloud.json' | |
base_key = 'prefixes' |
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
const NONCE_SECRET = "S3CR3T" // Identify where to inject nonces in your page | |
class ElementHandler { | |
constructor(generatedNonce, nonceReplaceValue) { | |
this.generatedNonce = generatedNonce | |
this.nonceReplaceValue = nonceReplaceValue | |
} | |
element(element) { | |
// An incoming element, such as `div` |