Skip to content

Instantly share code, notes, and snippets.

View machawk1's full-sized avatar

Mat Kelly machawk1

View GitHub Profile
@N0taN3rd
N0taN3rd / nukeBloggerClickTrap.js
Created April 27, 2018 20:29
Remove the annoying blogger preview click trap element.
// what substring in the URL indicates to us that we are editing the blog post
let isPostPreview = 'post-preview'
// the query selector to use for referencing the click trap element
let querySelectorForClickTrap = '.blogger-clickTrap'
// how long should the delay be before we attempt to remove the click trap element
let wait = 3000
if (window.location.href.indexOf(isPostPreview) !== -1) {
setTimeout(() => {
console.log('nukeClickTrap')
let it = document.querySelector(querySelectorForClickTrap)
@prologic
prologic / LearnGoIn5mins.md
Last active March 23, 2026 03:33
Learn Go in ~5mins
@weiglemc
weiglemc / capture-requests.py
Created January 18, 2023 21:36
Python script using selenium-wire to render a webpage and capture specific requests that it generates
# run the script on a set of URI-Ms:
# python3 capture-requests.py < to-request.txt >> requests-log.txt
# process the results and generate a new list of URI-Ms that were requested:
# awk '{if ($1 ~ /cnn\.com(:80)?[\/]+$/ && $2 == "200") print $0}' requests-log.txt | sort -t '/' -k 5 >! requests.txt
# https://pypi.org/project/selenium-wire/#installation
import sys
import time
from seleniumwire import webdriver # Import from seleniumwire
@ldko
ldko / heritrix_from_source.md
Last active December 5, 2024 21:26
Building Heritrix from main branch for use with ExtractorYoutubeDL

Install maven and java with coordinating versions that work with your system and Heritrix (see https://github.com/internetarchive/heritrix3/blob/master/.github/workflows/maven.yml):

sudo dnf install maven-openjdk17

Building latest Heritrix (in this example, I put heritrix distributions at /usr/local/ and have a symlink named h3 that points to the one I currently use, i.e. /usr/local/h3 is a symlink pointing to /usr/local/heritrix-3.6.1-SNAPSHOT-20241205)

cd /tmp
git clone https://github.com/internetarchive/heritrix3.git
cd heritrix3