Last active
February 26, 2025 09:23
Revisions
-
glenjamin revised this gist
Feb 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Create a bookmark named "Honeycomb Environment Switcher" Set the target URL as the following, which is the content from `full.js` with newlines and indents removed. ``` javascript:(() => {const f = (tag, text) =>Array.from(document.querySelectorAll(tag)).find((el) => el.textContent === text,);f('button', 'Share').click();setTimeout(() => {f('button', 'Get Template Link').click();setTimeout(() => {const h = f('h4', 'Query Template Link');let url = h.closest('section').querySelector('textarea').value;const swap = ['/production/', '/staging/'];if (url.includes('/staging/')) swap.reverse();url = url.replace(...swap);location.href = url;}, 10);}, 10);})(); ``` When you click this bookmark from a query page, you'll be switched to the same query but run against the other environment. -
glenjamin revised this gist
Nov 15, 2024 . 1 changed file with 12 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,15 @@ # Honeycomb env-switching bookmarklet This will toggle between the `staging` and `production` environments by default. Adjust the naming if that isn't what yours are called. ## Setup Create a bookmark named "Honeycomb Environment Switcher" Set the target URL as the following, which is the content from `full.js` with newlines and indents removed. ``` javascript:(() => {const f = (tag, text) =>Array.from(document.querySelectorAll(tag)).find((el) => el.textContent === text,);f('button', 'Share').click();setTimeout(() => {f('button', 'Get Template Link').click();setTimeout(() => {const h = f('h4', 'Query Template Link');let url = h.closest('section').querySelector('textarea').value;const swap = ['/production/', '/staging/'];if (url.includes('/staging/')) swap.reverse();url = url.replace(...swap);location.href = url;}, 10);}, 10);})();]) ``` When you click this bookmark from a query page, you'll be switched to the same query but run against the other environment. -
glenjamin created this gist
Nov 15, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # Honeycomb env-switching bookmarklet Save the following bookmarklet as a bookmark <a href="javascript:(() => {const f = (tag, text) =>Array.from(document.querySelectorAll(tag)).find((el) => el.textContent === text,);f('button', 'Share').click();setTimeout(() => {f('button', 'Get Template Link').click();setTimeout(() => {const h = f('h4', 'Query Template Link');let url = h.closest('section').querySelector('textarea').value;const swap = ['/production/', '/staging/'];if (url.includes('/staging/')) swap.reverse();url = url.replace(...swap);location.href = url;}, 10);}, 10);})();]">Honeycomb Environment Switcher</a> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ (() => { const f = (tag, text) => Array.from(document.querySelectorAll(tag)).find( (el) => el.textContent === text, ); f('button', 'Share').click(); setTimeout(() => { f('button', 'Get Template Link').click(); setTimeout(() => { const h = f('h4', 'Query Template Link'); let url = h.closest('section').querySelector('textarea').value; const swap = ['/production/', '/staging/']; if (url.includes('/staging/')) swap.reverse(); url = url.replace(...swap); location.href = url; }, 10); }, 10); })();