This file contains 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
/* Welcome to lib-singlepageapp.js! This script is meant to handle using single-page | |
applications (SPAs) for Tealium when you do not have direct access to Angular, Vue, | |
React, etc. for making modifications. This allows us to get around limitations of | |
utag.view(). The trigger in this case is a global event listener that evaluates | |
any time there is a click, HTML5 history API replacement, load event, or DOMContentLoaded | |
event. If a new URL is populated via the history API, we'll treat that as a "pageview". | |
Note in this case that I have defined a UDO variable of page. This variable is then mapped | |
to anything requiring a page URL. For example, in GA I have this variable mapped to | |
config.page_location so it acts like a native page URL view.*/ |
This file contains 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
-- create two tables: L and R | |
-- content of tables a "val" column with two rows. | |
-- rows in L: "left only" and "both" | |
-- rows in R: "right only" and "both" | |
with l as ( | |
select 'both' as val | |
union | |
select 'left_only' as val | |
), r as ( |
This file contains 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
#!/bin/bash | |
# Add to instance metadata with `gcloud compute instances add-metadata \ | |
# instance-name --metadata-from-file startup-script=idle-shutdown.sh` and reboot | |
# NOTE: requires `bc`, eg, sudo apt-get install bc | |
# Modified from https://stackoverflow.com/questions/30556920/how-can-i-automatically-kill-idle-gce-instances-based-on-cpu-usage | |
threshold=0.1 | |
count=0 | |
wait_minutes=60 | |
while true |