This file contains hidden or 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
/* | |
This code should be put directly after the ga create call, before any hits are fired to ensure | |
it captures all hits being sent to ga. | |
When any ga hit is fired, this code will capture it, fire the proper hit into GA and then forward | |
the hit query parameters to GTM via a dataLayer event. | |
The dataLayer event is called "gaHitTask" and the query parameters are sent in the "gaHitTaskParams" variable. | |
You can use code something similar to this: https://gist.github.com/MatthewDaniels/388fa1e0c02613f103f00a504ed58c55 |
This file contains hidden or 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
/** | |
* Get a query map based on a query string. | |
* | |
* The function will populate a map variable with key value pairs of the parameters. | |
* | |
* If there is more than one of the same key, the function will populate an array in the map with the multiple values within it | |
* | |
* @param {string} query The query string - the question mark is optional | |
* @return {object} key value pairs of the parameter / value of the parameter | |
*/ |
This file contains hidden or 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
/** | |
* Reverses the input url. | |
* | |
* EG: if the url is www.google.com, the result will be com.google.www - this is useful for sorting a sheet | |
* | |
* @param {string} input The url to reverse. | |
* @return The url reversed. | |
* @customfunction | |
*/ | |
function REVERSEURL(string) { |
This file contains hidden or 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
sudo apt-get -y install php7.2 php7.2-dev php7.2-mysql php-apcu php7.2-gd php7.0-mcrypt php-memcache php7.2-curl php7.2-tidy php-xml php-json php7.2-mbstring php-gettext libmcrypt-dev mcrypt php-gd libmcrypt4 libmhash2 libtidy5 libxslt1.1 php-apcu-bc php-pear php7.2-mbstring php7.2-xml php7.2-fpm php7.2 php-mongodb | |
# remove apache | |
update-rc.d -f apache2 remove | |
apt-get remove apache2 | |
sudo update-rc.d -f php7.2-fpm default | |
sudo service php7.2-fpm restart |
This file contains hidden or 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
// Iterates all of the dimensions in the edit dimensions list in Google Analytics (only accounts for users with edit rights) & outputs the list, MINUS the dimension number | |
let list = document.querySelectorAll('.ID-editDimension > a'); | |
list.forEach((value,key) => { let r = /(?:\d+\. )?(.*)/i; let b = r.exec(value.text); if(b) console.log(b && b[1]) }); |
This file contains hidden or 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 | |
# VARS | |
PROJECT=my-project | |
DATASET_NAME=Datisan_TEST | |
# tables will have the structure day_tables_prefix_yyyyMMdd (sharded daily tables) | |
TABLE_PREFIX=day_tables_prefix | |
# make sure we are on the right project |
This file contains hidden or 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 | |
bq show --format=prettyjson bigquery-public-data:github_repos.commits | jq '.schema.fields' > github-commits-schema.json |
This file contains hidden or 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 | |
RED='\033[0;31m' | |
YELLOW='\033[1;33m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
echo | |
echo | |
echo -e "${GREEN}╭──────────────────────────────────────────────────────────────────────╮${NC}" |
This file contains hidden or 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 | |
RED='\033[0;31m' | |
YELLOW='\033[1;33m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
echo | |
echo | |
echo -e "${GREEN}╭──────────────────────────────────────────────────────────────╮${NC}" |
This file contains hidden or 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
/** | |
* Get Dom Element with Regex - matches regular expression against the attribute value. | |
* | |
* @param regex Regex The regular expression to match the attribute value on | |
* @param selectorStr String An optional string to further refine the initial selector (used in the querySeelctorAll) - @default * | |
* | |
* @return array of objects containing the element, the attriube name and value OR null if none are matched. | |
*/ | |
function getDomElementWithRegex(regex, selectorStr) { | |
if(!regex) return null; |