Skip to content

Instantly share code, notes, and snippets.

View kyletolle's full-sized avatar

Kyle Tolle kyletolle

View GitHub Profile
global.helloWorldText = 'Hello, world!';
helloWorld = function() {
console.log(global.helloWorldText);
return global.helloWorldText;
};
helloWorld();
@kyletolle
kyletolle / filesDeleted.js
Created December 18, 2023 20:19
Github PR review: Snippet to check viewed on files renamed without changes or deleted
// In a GitHub PR, you can run this script in a console to help automatically click the Viewed checkbox
// Worked as of 2023.12.18
// JS snippet to click 'Viewed' on files that were deleted entirely, not changed or renamed
Array.from(document.querySelectorAll('.js-diff-load')).forEach(fileInfo => {
const text = fileInfo.nextElementSibling.textContent.trim();
if(text.includes('This file was deleted.')) {
const viewedCheckbox = fileInfo.closest('.js-file.js-details-container').querySelector('.js-reviewed-checkbox');
if(viewedCheckbox && !viewedCheckbox.checked) {
viewedCheckbox.click();
}
@kyletolle
kyletolle / changeTextExample.html
Last active May 30, 2024 20:31
Some simple HTML pages to share with Maisie
<!DOCTYPE html>
<html>
<head>
<title>Change Text Example</title>
</head>
<body>
<h1>Change Text with JavaScript</h1>
<p id="myParagraph">This is the original text.</p>
<button onclick="changeText()">Change Text</button>
<button onclick="fooblap()">Button without a Function!</button>