Skip to content

Instantly share code, notes, and snippets.

View jhildenbiddle's full-sized avatar

John Hildenbiddle jhildenbiddle

View GitHub Profile
@jhildenbiddle
jhildenbiddle / background.js
Last active April 29, 2023 04:22
Chrome Extension (MV3): Read Google Tag Manager dataLayer
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
(async () => {
const { action } = request;
const { tab } = sender;
// Get global value(s) from main frame
if (action === 'get-datalayer') {
const injectionResults = await chrome.scripting.executeScript({
target: { tabId: tab.id },
func: () => window.dataLayer,
@jhildenbiddle
jhildenbiddle / piatoggle.sh
Last active February 8, 2021 17:50
Toggle Private Internet Access VPN
#!/bin/bash
# Toggle Private Internet Access VPN
# https://gist.github.com/jhildenbiddle/f910555cc32114e7b4c30f862a00ec60
#
# Requires installation of PIA app
# https://www.privateinternetaccess.com/pages/download
# Set path to piactl (use `which piactl` to determine)
piactl="/usr/local/bin/piactl"