Skip to content

Instantly share code, notes, and snippets.

View SeanMcP's full-sized avatar

Sean McPherson SeanMcP

View GitHub Profile
@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==
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 / 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==
(() => {
@SeanMcP
SeanMcP / google-meet-timer.console.js
Last active May 17, 2022 17:13
Sets a timer for Google Meet with chat messages.
;(function() {
let textarea = document.querySelector('textarea[aria-label="Send a message to everyone"]')
let submit = document.querySelector('[role="button"][aria-label="Send a message to everyone"]')
if (!textarea || !submit)
return alert('Uh oh! Something went wrong. Do you have the chat panel open?')
function sendMessage(text) {
textarea.click()
textarea.value = text

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 / 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]++;
@SeanMcP
SeanMcP / react-in-x.md
Created February 12, 2020 11:33
Key concepts to understand to become a React developer

The order is appoximate:

  1. HTML & CSS
  2. JavaScript: data types, structures, loops, methods, promises
  3. React by CDN
  4. Node.js
  5. Node modules
  6. Babel & Webpack
  7. ES6 Basics: import, export, destructuring
  8. create-react-app
{"lastUpload":"2020-02-20T11:14:48.323Z","extensionVersion":"v3.4.3"}
@SeanMcP
SeanMcP / path.txt
Created October 15, 2019 20:58
Firefox settings
Users/<username>/Library/Application Support/Firefox/Profiles/xxxxxxxx.default
@SeanMcP
SeanMcP / user.js
Last active September 18, 2019 17:20
Filter options in "Awesome Design Systems"
// ==UserScript==
// @name Filter options in "Awesome Design Systems"
// @version 1
// @grant none
// @match https://github.com/alexpate/awesome-design-systems
// ==/UserScript==
(() => {
'use strict'