Skip to content

Instantly share code, notes, and snippets.

@glued
glued / golf.js
Last active January 9, 2022 02:35
Gas Pump Golf Perfect score (https://gaspumpgolf.github.io/)
// 1. https://gaspumpgolf.github.io/
// 2. Click play
// 3. Open console
// 4. Paste code and press enter
const down = new MouseEvent("mousedown", { bubbles: true, cancelable: true, view: window });
const up = new MouseEvent("mouseup", { bubbles: true, cancelable: true, view: window });
const btn = document.querySelector('#content > button');
const target = document.querySelector('#content > p:nth-child(3) > mark > strong');
const sale = document.querySelector('#content > p:nth-child(5) > strong');
const observer = new MutationObserver((val)=>{
@glued
glued / background.js
Last active January 21, 2022 19:20
Tabbycat ~ Chrome extension to group tabs into tabGroups by domain
const URL_REGEX = /^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/gim;
const GOOG = ".google.com";
const domainFromUrl = (url) => {
if (url.includes(GOOG)) {
const segments = url.split("/");
const googIdx = segments.findIndex((item) => item.includes(GOOG));
return segments[googIdx + 1];
}