Skip to content

Instantly share code, notes, and snippets.

View zachrenwick's full-sized avatar

Zach Renwick zachrenwick

View GitHub Profile
@sayle-doit
sayle-doit / bq_storage_across_org.sql
Last active June 16, 2023 17:55
Determine BigQuery Storage Costs Across an Organization for Both Compressed (Physical) and Uncompressed (Logical) Storage
/*
* This query will run across an entire organization looking at tables across every project
* and shows how they will compare on compressed and uncompressed storage.
*
* Region Notes:
* This query will only read from a single region or multi-region at a time. It's
* currently not possible to read this data from across all
*
* By default this reads from the US multi-region, so this might need to be changed if
* your data lives elsewhere.
@slopp
slopp / HotTakes.md
Last active June 20, 2023 21:49
Dagster Hot Takes

Dagster Hot Takes

Less On-Call Pages: Retries and Alerts

https://youtu.be/A6WtkMwe4VQ

Getting an on-call page is the worst. Unfortunately most task-based orchestrators page teams frequently, whenever jobs fail. With Dagster you can reduce this alert fatigue by using retry strategies and only getting notified when SLAs are violated.

Resources:

@adityawarmanfw
adityawarmanfw / GA4_flatten_table_keep_rests_of_params.sql
Last active August 17, 2023 05:03
GA4 and BigQuery, converting event_params as columns and keeping the rest of event_params as an array of structs.
SELECT event_timestamp,
user_pseudo_id,
(SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS ga_session_id,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_title') AS page_title,
(ARRAY(SELECT AS STRUCT * FROM UNNEST(event_params) WHERE key NOT IN ('ga_session_id', 'page_title'))) AS rest_of_event_params
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_20210131`
WHERE event_name = 'page_view'
LIMIT 1
@Hugoberry
Hugoberry / SparksTheme.json
Created March 21, 2021 18:40
PowerBI theme which uses Sparks font for sparkline rendering in matrix/pivot tables
{
"name": "Sparkline Typeface",
"visualStyles": {
"pivotTable": {
"Default": {
"values": [
{
"fontFamily": "Sparks Bar"
}
]
@troyharvey
troyharvey / README.md
Last active April 25, 2024 23:18
GitHub Action for running the getdbt.com dbt CLI with BigQuery

Using GitHub Actions to run dbt

This example shows you how to use GitHub Actions to run dbt against BigQuery.

  1. Follow the instructions on getdbt.com for installing and initializing a dbt project.

  2. Copy this action (dbt.yml) into the workflows directory.

     mkdir .github
     mkdir .github/workflows
    

cp ~/Downloads/dbt.yml .github/workflows/

@SQLvariant
SQLvariant / Export_PBI_AuditLogs.ipynb
Created December 10, 2019 19:22
PowerShell Notebook showing how to use both cmdlets available for extracting Power BI audit log events
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattmc3
mattmc3 / modern_sql_style_guide.md
Last active April 27, 2024 00:11
Modern SQL Style Guide
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@voltek62
voltek62 / api-similarweb.R
Last active June 4, 2020 16:09
get Web Traffic Data from SimilarWeb API with R
library(httr)
library(jsonlite)
# https://dataseolabs.com
# Doc : https://www.similarweb.com/corp/developer/
# Create your key here : https://pro.similarweb.com/#/account/api-management
# You can have freely 3 Months of Web Traffic Data
# conf
myList <- c("cuisineaz.com","marmiton.org","odelices.com","allrecipes.fr")
@jstangroome
jstangroome / Deploy-SSRSProject.ps1
Created July 3, 2012 22:37
PowerShell scripts to deploy a SQL Server Reporting Services project (*.rptproj) to a Reporting Server
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidatePattern('\.rptproj$')]
[ValidateScript({ Test-Path -PathType Leaf -Path $_ })]
[string]
$Path,
[parameter(