Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View leighajarett's full-sized avatar

Leigha Jarett leighajarett

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighajarett
leighajarett / bq_var.sql
Last active April 5, 2021 21:57
Declare a Variable in BigQuery
-- Declare a variable to hold the timeframe (month, quarter or year)
DECLARE timeframe STRING DEFAULT "month";
@leighajarett
leighajarett / PTD_Analysis.ipynb
Created April 13, 2021 15:57
BigQuery Period to Date
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighajarett
leighajarett / gis_examples.ipynb
Last active March 22, 2024 16:56
Examples for leveraging the BigQuery Public Geo Boundaries tables for geospatial analytics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighajarett
leighajarett / sample_slides_appscript.gs
Created August 18, 2021 02:28
sample_bq_slide_appscript
//// Using BigQuery query results to populate a template slide deck ////
// This object defines the queries associate with each of the params used in the template
var queryObj = {
"new_cust": "SELECT COUNT(*) FROM `looker-private-demo.retail.customers` as custs " +
"JOIN `looker-private-demo.retail.transaction_detail` as trans ON custs.id = trans.customer_id " +
", UNNEST(trans.line_items) as line_items " +
"WHERE TIMESTAMP_TRUNC(custs.created_at,WEEK) = @week " +
"AND line_items.product_id in (select id from `looker-private-demo.retail.products` where category = @team);",
"rep_rate": "WITH repeat_orders as " +
@leighajarett
leighajarett / code.gs
Created November 15, 2021 15:05
Example of using Apps Script to populate Google Slides with data from BigQuery
//// Using BigQuery query results to populate a template slide deck ////
// This object defines the queries associate with each of the params used in the template
// Note that you may want to use functions defined within BigQuery instead of parameterized queries
var queryObj = {
"new_cust": "SELECT COUNT(*) FROM `looker-private-demo.retail.customers` as custs " +
"JOIN `looker-private-demo.retail.transaction_detail` as trans ON custs.id = trans.customer_id " +
", UNNEST(trans.line_items) as line_items " +
"WHERE TIMESTAMP_TRUNC(custs.created_at,WEEK) = @week " +
"AND line_items.product_id in (select id from `looker-private-demo.retail.products` where category = @team);",
@leighajarett
leighajarett / main.dart
Last active November 3, 2022 19:19
flutter_ios_get_started
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// #docregion main
void main() {
runApp(const MyApp());
}
// #enddocregion main
@leighajarett
leighajarett / main.dart
Last active November 3, 2022 19:26
Flutter Text Button
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@leighajarett
leighajarett / main.dart
Created November 4, 2022 15:05
Flutter Row Example
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});