Skip to content

Instantly share code, notes, and snippets.

View Garlando's full-sized avatar

Craig Garlick Garlando

View GitHub Profile

A Somewhat More Involved Date Comparison

An example page for https://www.evidence.studio/

Introduction

Many Components now have a "compare to" option, and thats going to serve most purposes, but what if you want to plot a metric over time against a comparison period?

This is definitely more involved, but it solves that case, and allows for a little less repetition in component settings. This is probably not the only way to do it, just an example for anyone that might find it useful

This example only uses the demo_daily_orders source, so can be tried out by anyone

@Garlando
Garlando / !generate_manifests.py
Last active April 18, 2023 16:25
Create a manifest file for Redshift from specific objects in S3
import boto3
import json
def get_matching_objects(line, s3):
continuation_token = None
entries = []
while True:
if continuation_token is None:
response = s3.list_objects_v2(Bucket='my-bucket', Prefix='prefix/'+line)