Note: all scripts tested only in Mozilla Firefox.
Template Base template for bookmarklets/keyword searches
Localhost/production toggler
Toggle between localhost
and production
/* jshint esversion: 8 */ | |
(function () { | |
const fallback = "https://ports.macports.org/"; | |
const keyword = "%s"; | |
const service = "https://ports.macports.org/search/"; | |
const suffix = "&name=on"; | |
if (keyword !== "" || keyword !== "%" + "s") { | |
window.location = `${service}?q=${keyword}${suffix}`; | |
} else { |
/* jshint esversion: 8 */ | |
(function () { | |
const fallback = null; | |
const keyword = "%s"; | |
const service = "https://greensdictofslang.com/"; | |
if (keyword !== "" || keyword !== "%" + "s") { | |
window.location = `${service}search/basic?q=${keyword}`; | |
} else { | |
window.location = fallback || service; |
/* jshint esversion: 8 */ | |
(function () { | |
// Sweden (`sv`) outputs something close to ISO | |
const currentDate = new Date().toLocaleDateString("sv", { | |
timeZone: "America/Chicago", | |
}); | |
const parameters = | |
"?locations=51&programs=5c9261756fdc8d742d2296a5" + | |
"&startDate" + | |
currentDate.split("T")[0].replace("T", ""); |
Note: all scripts tested only in Mozilla Firefox.
Template Base template for bookmarklets/keyword searches
Localhost/production toggler
Toggle between localhost
and production
/* jshint esversion: 8 */ | |
(function (currentDocument) { | |
const treeWalker = currentDocument.createTreeWalker(currentDocument.body, NodeFilter.SHOW_ELEMENT); | |
const width = currentDocument.documentElement.offsetWidth; | |
while (treeWalker.nextNode()) { | |
const domRectangle = treeWalker.currentNode.getBoundingClientRect(); | |
if (domRectangle.right > width || domRectangle.left < 0) { | |
const currentNode = treeWalker.currentNode; |
# Find and remove `.ds_store` files from local `git` repo | |
find . -name .ds_store -print0 | xargs -0 git rm -f --ignore-unmatch |
/* jshint esversion: 8 */ | |
(function () { | |
// List of verbs, for editing convenience | |
// am | |
// are | |
// be | |
// been | |
// being | |
// go | |
// hasn't |
/* jshint esversion: 8 */ | |
(function () { | |
const domain = "https://example.com"; | |
const isLocalhost = window.location.href.indexOf("localhost") >= 0; | |
const localhost = "http://localhost:8080"; | |
const pathname = window.location.pathname; | |
const url = isLocalhost ? (domain + pathname) : (localhost + pathname); | |
window.location = url; | |
})(); |
/* jshint esversion: 8 */ | |
(function () { | |
const fallback = null; | |
const keyword = "%s"; | |
const service = "https://www.example.com/"; | |
const suffix = ""; | |
if (keyword !== "" || keyword !== "%" + "s") { | |
window.location = `${service}?q=${keyword}${suffix}`; | |
} else { |