asd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(() => { | |
const url = location.href; | |
if (!url.includes('github.com/discord/discord')) { | |
alert("Not on github.com/discord/discord. Not prepared to move to main branch"); | |
return; | |
} | |
if (!url.includes("blob/")) { | |
alert("Not on a git blob/ path."); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Background: | |
// Word boundaries are 0 width assertions that are between \w (word characters) | |
// and \W (non-word characters) or start/end of the string. | |
// So, in a scenario like "-abc" there are 2 word boundaries: | |
// 1. between the '-' and the 'a' | |
// 2. between the 'c' and the end of the string | |
// | |
// Regex explanation: | |
// ^\\b_ -> Start matching by ensuring that we are at the beginning of the match, and that the | |
// underscore we are using as the sentinel to start the italics boundary is proceeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy(temp1.error.data.requestBody.transactions[0].operations | |
.filter(operation => operation.command === 'set' && Array.isArray(operation.args) && operation.args.length !== 0) | |
.map(operation => operation.args.flatMap(arg => Array.isArray(arg) ? arg[0] : arg).join('')) | |
.join('\n')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(async () => { | |
const HANDLERS = { | |
'github.com': handleGithub, | |
'app.asana.com': handleAsana, | |
'www.google.com': { | |
'/travel/flights/booking': handleGoogleFlights | |
} | |
}; | |
/* ----------- Github ------------- */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(() => { | |
const el = document.querySelector('[name="pull_request[body]"]'); | |
const markdownImageRegex = /!\[.*?\]\((.*?)\)/gm; | |
window.__PREVIOUS_PR_CONTENT = el.value; | |
const newVal = el.value.replaceAll(markdownImageRegex, (match, url) => `<img width="450" src="${url}">`); | |
el.value = newVal; | |
alert("Replacements complete. Preview content available in window.__PREVIOUS_PR_CONTENT"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getConfusableCharacters() { | |
const confusableCharactersTable = document.querySelector('table:has(h3)') | |
const tableRows = confusableCharactersTable.querySelectorAll('tr') | |
const unicodeRow = Array.from(tableRows[1].children) | |
const nameRow = Array.from(tableRows[2].children) | |
let values = '' | |
for (let i = 0; i < unicodeRow.length; i++) { | |
const unicode = unicodeRow[i].innerText |
Just straight to Complete Settings Files if you just wanna completely copy my setup
Please note, these are my custom assigned keybindings. The keybinds
below are not the default keybinds for these controls.
Name | Keybind | Description |
---|---|---|
Go Back | Cmd+Opt+LeftArrow | Navigates to your previous cursor position. Will also navigate between editor panes. Extremely useful for keeping context while exploring code. 1000% recommend |
Go Forward | Cmd+Opt+RightArrow | Navigates to your next cursor position (after you use GoBack). Will also navigate between editor panes. Extremely useful for keeping context while exploring code. |
Reveal Active File in Explorer View | Cmd+F1 | Scrolls the explorer view to the current editor file for easy context discovery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
/* Finds the "Viewed" button for each file, selecting only ones marked as already viewed */ | |
const allViewedFiles = Array.from(document.querySelectorAll('[data-ga-click="File viewed, click, value:true"]')); | |
/* Iterates through the viewed files and closes any that are still open. */ | |
const allOpenViewedFiles = allViewedFiles.forEach(viewedButton => { | |
const fileContainer = viewedButton.closest('.js-details-container'); | |
if (fileContainer.classList.contains('open')) { | |
const collapseButton = fileContainer.querySelector('.js-details-target'); | |
collapseButton.click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Vue Composition HigherOrderFunction (HOF) that will take a Vue Composition function and return a | |
* memoized version of that function. | |
* | |
* A Memoized function in a function that, when given the same inputs, will skip any calculations done by the function | |
* and instead return a cached result that matches the inputs. This allows us to skip any duplicate computation | |
* or other calculations that would occur by calling the function from multiple places but with the same inputs. | |
* | |
* It is expected that the resolver function will take the provided inputs and convert them to a keyable value | |
* that can be used in the internal cache. |
NewerOlder