Skip to content

Instantly share code, notes, and snippets.

View krisb1220's full-sized avatar
🎯
Focusing

Kris krisb1220

🎯
Focusing
  • USA
View GitHub Profile
.app-component-container.dashboard
.app-component-inner
h1.dashboard-view My Agenda
.dashboard-inner
-let dates = user.data.tasks
each date in dates
.date-container(data-date=date.meta.date)
p.date #{date.meta.date}
each task in date
if task != date.meta && task.isCompleted == false
@krisb1220
krisb1220 / GiveAllLinksUTMCodes.js
Created August 8, 2023 17:51
This script will give all links on your wordpress website UTM codes. Almost definitely works on other sites, haven't tested it. The utm_id will give you the index that the link appears in a Nodelist of all <a> tags. Could be optimized to look for an href instead of <a> tags, but I made it quick and dirty for my own purposes.
function makeAllLinksHaveUtmCodes() {
let linksArray = Array.from(document.querySelectorAll("a")).filter(function(item){
return item.href&&item.href.split("?").length==1&&!item.href.includes("wordpress"); //returns items that have an href, no query, and aren't WP links
});
console.log(linksArray);
let pageTitle = document.title.split("-")[0].trim();
let linkID = 0;