Skip to content

Instantly share code, notes, and snippets.

const walk = (acc = [], outer) => {
if (typeof outer === null) {
return acc
}
if (typeof outer === 'string') {
if (outer === ' ') {
return acc
}
@jgusta
jgusta / tagfactory.js
Last active July 1, 2024 06:15
DOM Tag Factory
const tf = function (attachPoint) {
const root = globalThis || window
const dom = root.document || document
function selectEl(el) {
if (el.ELEMENT_NODE) {
return el
}
else {
return dom.querySelector(el)
@jgusta
jgusta / SiteSucker.js
Last active February 12, 2025 14:46
A Javascript for Automation (JXA) script for automating SiteSucker for Mac with opinionated defaults.
/**
CHANGELOG
2-10-25 - Ask about whether to use webviews.
*/
/**
* This script is a JavaScript for Automation (JXA) script that uses the SiteSucker app to download a website.
*
* Background: JXA is dogshit. I know there is no need to hold back on the cursing, because if you are using JXA,
* you have already explored every explitive available. The official JXA documentation is apple's changelog which