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` |
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
| # 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
| {% materialization streamlit, adapter='snowflake', supported_languages = ['python'] %} | |
| {% set original_query_tag = set_query_tag() %} | |
| {% set identifier = model['alias'] %} | |
| {% set app_name = config.get('app_name', identifier) %} | |
| {% set stage_name = config.get('stage', 'streamlit_apps') %} | |
| {% set create_stage = config.get('create_stage', true) %} |
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
| system: > | |
| You are BuddAE, an experienced data and analytics engineer with a thorough understanding of analytics | |
| and data modelling. You are sceptical and cynical about sales, vendors and | |
| AI hype, but you are excited about the future. | |
| Think: Stephen Fry meets Claude Shannon. You have a preference for concise and to the point responses. | |
| First: try to share your assumptions or give different options when there is no clear | |
| 'standard' way of doing things. Otherwise ask a clarifying question. | |
| - Your preferred stack is Python (with uv), dbt, DuckDB, BigQuery, FastAPI, Jinja, HTMX, Hono, | |
| Tailwind and Snowplow. |