Skip to content

Instantly share code, notes, and snippets.

View SeanMcP's full-sized avatar

Sean McPherson SeanMcP

View GitHub Profile
@SeanMcP
SeanMcP / console-script.js
Last active April 5, 2020 00:24
Most common words - BibleGateway.com
Object.entries(
[...document.querySelectorAll('.result-text-style-normal p')] // get all paragraphs
.map(p => p.textContent) // compress child nodes into text
.join() // make one big string
.split(' ') // split into individual words
.map(s => s.replace(/[^A-Za-z]/g, "").toLowerCase()) // remove non-letters and standardize
.filter(s => s) // remove empty spaces
.reduce((acc, word) => {
if (!acc[word]) acc[word] = 0;
acc[word]++;

Examples for Accessibility for the rest of us.

For the screenshots, I:

  • Increased the zoom level to 150%
  • Took a screenshot of the table nodes with Firefox DevTools
@SeanMcP
SeanMcP / read-vendor-files.user.js
Created October 1, 2020 17:11
Mark all vendor files as viewed in Niche PRs
// ==UserScript==
// @name Mark all vendor files as viewed in Niche PRs
// @namespace Niche Scripts
// @match *://github.com/nicheinc/*/pull/*/files
// @grant none
// @version 1.0
// @author Learn Over Lunch
// @description 10/1/2020, 12:40:56 PM
// ==/UserScript==
(() => {
copy([...$$('.repo-list-item')].map(node => {
const link = node.querySelector('.f4 a')
const description = node.querySelector('p.mb-1')
let string = `- [\`${link.textContent.trim()}\`](${link.href})`
if (description) string += ` - ${description.textContent.trim()}`
return string
}).join('\n'))
@SeanMcP
SeanMcP / github-explorer.user.js
Created February 10, 2021 15:10
Add links to explore GitHub repository in GitHub1s or CodeSandbox
// ==UserScript==
// @name GitHub Explorer
// @namespace https://seanmcp.com
// @version 0.1
// @description Add links to explore GitHub repository in GitHub1s or CodeSandbox
// @author Sean McPherson
// @match *://github.com/*/*
// @grant none
// ==/UserScript==
@SeanMcP
SeanMcP / anchored-headings.user.js
Created February 10, 2021 15:35
Add anchors to all headings with an id
// ==UserScript==
// @name Anchored Headings
// @namespace https://seanmcp.com
// @version 0.1
// @description Add anchors to all headings with an id
// @author Sean McPherson
// @match *://*/*
// @grant none
// ==/UserScript==
@SeanMcP
SeanMcP / github-cr-toolbox.console.js
Last active February 18, 2021 17:47
🧰 Floating tools to make code reviews on GitHub a little easier
(function githubCrToolbox() {
if (document.body.dataset.gcrt) return;
document.body.setAttribute("data-gcrt", true);
// Add styles to document.head
const styleEl = document.createElement("style");
styleEl.setAttribute("data-gcrt", true);
styleEl.innerText = `
details[data-gcrt] {
--border: 1px solid var(--color-border-primary);
@SeanMcP
SeanMcP / github-cr-toolbox.user.js
Created February 18, 2021 17:55
🧰 Floating tools to make code reviews on GitHub a little easier
// ==UserScript==
// @name GitHub CR Toolkit
// @namespace https://niche.com
// @version 0.2
// @description Floating tools to make code reviews on GitHub a little easier
// @author #learn-over-lunch
// @match https://github.com/*/*/pull/*/files*
// @grant none
// ==/UserScript==
@SeanMcP
SeanMcP / google-meet-ui.user.js
Last active March 10, 2021 18:21
Small improvements to the Google Meet UI
// ==UserScript==
// @name Google Meet UI Improvements
// @namespace https://seanmcp.com
// @version 0.2
// @description Small improvements to the Google Meet UI
// @author Sean McPherson
// @match https://meet.google.com/*
// @grant none
// ==/UserScript==
@SeanMcP
SeanMcP / increase-audio-playback.user.js
Created February 18, 2021 18:25
🎧 Increase the playback speed of audio elements around the web
// ==UserScript==
// @name Increase audio playback
// @namespace https://seanmcp.com
// @version 0.1
// @description Increase the playback speed of audio elements around the web
// @author Sean McPherson
// @match *://*/*
// @grant none
// ==/UserScript==