Skip to content

Instantly share code, notes, and snippets.

View struski's full-sized avatar

Michael Struski struski

View GitHub Profile
@struski
struski / gcloud_one_node_cluster.sh
Last active July 16, 2017 17:21
struscode.com - Google Cloud Platform 300 dollar free trial tutorial - Create a one node cluster
gcloud config set project example
gcloud config set compute/zone europe-west1-d
gcloud container clusters create my-cluster --num-nodes 1 --machine-type g1-small
gcloud container clusters get-credentials my-cluster --zone europe-west1-d --project example
#standardSQL
-- Create temporary function to calculate
-- acurracy of Common Air Quality Index calculation
-- There are six pollutants in total. If all pollutant readings
-- are available then accuracy is 100%.
-- The less pollutant readings there are the worse the CAQI calculation accuracy is.
-- This function takes in an array of sensor readings and returns single FLOAT64
CREATE TEMPORARY FUNCTION getCAQIAccuracy (
sensor_reading ARRAY<STRUCT<pollutant STRING, value FLOAT64>>
)