Skip to content

Instantly share code, notes, and snippets.

View noahlearner's full-sized avatar

Noah Learner noahlearner

View GitHub Profile
/* horseman-config data-type-string */
const sanitizeHtml = (await import('https://cdn.skypack.dev/sanitize-html')).default
let output = sanitizeHtml(document.querySelector('main').innerHTML, {
allowedTags: [
'address',
'article',
'aside',
'footer',
javascript: (function() { var e = document.querySelectorAll("#i7 > div.FAZ4xe.FoDaAb.hjTnPc > span > span > div > a > span");let t = []; for (let n = 0; n < e.length; n++){ let o = e[n].innerText;t.push(o)}var n = t.filter((function (e, t, n) { return n.indexOf(e) === t })).filter(Boolean);n.toString();linksOut = n.join("\n");var o = document.createElement("a");function c(e) {navigator.clipboard ? navigator.clipboard.writeText(e).then((function () { }), (function (e) { })) : function (e) {var t = document.createElement("textarea");t.value = linksOut, t.style.top = "0", t.style.left = "0", document.body.appendChild(t), t.focus(), t.select(); try { document.execCommand("copy") } catch (e) { } document.body.removeChild(t)}}o.id = "copy", o.href = "#", o.innerText = "Copy Links", o.style.fontSize = "x-large", document.body.querySelector(".dAEiw.dXdtIf").appendChild(o), o.addEventListener("click", (function (f) {f.preventDefault(); c(linksOut) }))}());
javascript: (function(){var styles = '::-webkit-scrollbar-thumb:hover { background: #eee; }';styles += '::-webkit-scrollbar-thumb { background: #eee; min-height: 50px; }';styles += '::-webkit-scrollbar-track { background: #111; }';styles += '::-webkit-scrollbar { width: 15px; }';var css = document.createElement('style'); css.type = 'text/css'; if (css.styleSheet) css.styleSheet.cssText = styles; else css.appendChild(document.createTextNode(styles));document.getElementsByTagName("head")[0].appendChild(css); }());
javascript:(function(){var a=(document.selection?document.selection.createRange().text:document.getSelection()).toString();alert(a.length?"Characters: "+a.length+"\nWords: "+a.replace(/\s{2,}/g," ").split(" ").length:"No text selected.")})();
@noahlearner
noahlearner / gist:d7001e7a23c52e003d154d55e0257dcb
Created March 18, 2021 12:46
Google's cache of current page
javascript: (function(){url='https://webcache.googleusercontent.com/search?strip=0&q=cache:'+encodeURIComponent(location.href);javascript:window.open(url);}());
<!--
Go to your YouTube video.
Click Share
Copy The link: https://youtu.be/rW_Zjdnzc1k
Grab the id from Video. In the example above, it would be rW_Zjdnzc1k
replace the xxx in the code below with the id from the previous step
paste the code on Page.
Boatdrinks for all!!!
-->
const puppeteer = require('puppeteer-extra')
// add stealth plugin and use defaults (all evasion techniques)
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
// Add adblocker plugin to block all ads and trackers (saves bandwidth)
const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker')
puppeteer.use(AdblockerPlugin({
blockTrackers: true
}))
const pupeteer = require('puppeteer');
const clients = require('./clients');
const URL = require('url');
const request = require('request');
function delay(time) {
return new Promise(function(resolve) {
setTimeout(resolve, time)
//************************************************
//* This script is used to pull in Scheduled Screaming frog crawls
//************************************************
function doPost(e){
importCSVFromGoogleDrive();
}
function doGet() {
importCSVFromGoogleDrive();
}
@noahlearner
noahlearner / index.js
Last active July 28, 2019 02:14
Teamwork Projects Monthly recurring tasklists automation
const express = require('express'),
fetch = require('node-fetch'),
btoa = require('btoa'),
app = express(),
moment = require('moment'),
company = "xxx", //change to your Teamwork Company Name
key = "xxx"
// change to your api key. Click on your Initials > edit my details > api key and mobile found in top Corner of your teamwork log in.