Skip to content

Instantly share code, notes, and snippets.

View thefeaturecreature's full-sized avatar
🍤

Evan Dierlam thefeaturecreature

🍤
  • Portland, OR
View GitHub Profile
@thefeaturecreature
thefeaturecreature / queryvar-passthrough.js
Last active April 15, 2026 17:47
Queryvar passthrough for landing page platforms
window.onload = function() {
if(window.location.search!==''){
const urlQuery = window.location.search.replace('?','').split('&').reduce(function(obj, str, index) {
let strParts = str.split("=");
obj[strParts[0].replace(/\s+/g, '')] = strParts[1];
return obj;
}, {});
document.querySelectorAll('a').forEach((e) => {
let newQuery;
@thefeaturecreature
thefeaturecreature / pagespeed-lookup-bookmarklet.js
Last active April 15, 2026 17:50
Google Page Speed & Insights for current prompt
javascript:(function() { var urll = prompt("Check what page?", window.location.href); window.open("https://pagespeed.web.dev/report?url=" + urll, "_blank"); })()
@thefeaturecreature
thefeaturecreature / ratio-iframe-css.js
Last active April 15, 2026 17:53
Build css for iframes by ratio
document.querySelectorAll(".article-body iframe").forEach(el => {
const w = el.getAttribute("width"), h = el.getAttribute("height");
el.style.setProperty("--x", h / w);
el.style.maxWidth = w + "px";
el.style.maxHeight = h + "px";
el.style.height = "calc(var(--x) * 90vw)";
});
javascript:(function() {
const answer = prompt("What should I say?") || "Fine, don't tell me.";
const speak = () => {
const msg = new SpeechSynthesisUtterance(answer);
msg.rate = 0.7;
msg.pitch = 0.8;
msg.voice = speechSynthesis.getVoices().find(v => v.name === "Fiona");
speechSynthesis.speak(msg);
};
speechSynthesis.getVoices().length ? speak() : speechSynthesis.addEventListener("voiceschanged", speak, {once: true});