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
## brew install pyenv pyenv-virtualenv | |
## pyenv install 3.8.13 | |
layout pyenv 3.8.13 |
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
interface AdvisoryReport { | |
id: number; | |
url: string; | |
title: string; | |
severity: string; | |
vulnerable_versions: string; | |
cwd: string[]; | |
cvss: { | |
score: number; |
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
javascript:(()=>{"function"==typeof window.__themeListenerUnsubscribe&&(window.__themeListenerUnsubscribe(),window.__themeListenerUnsubscribe=void 0);const e=window.matchMedia("(prefers-color-scheme: dark)"),t=async e=>{/255/.test(getComputedStyle(document.querySelector("#gbwa path")).getPropertyValue("color"))!==e.matches&&(async e=>{const t=e=>new Promise((t=>setTimeout(t,e)));var c=`[bgid="basic${e}"]:not(.a7J)`,o='[aria-label="Theme"] + button',n=document.querySelector(c),r=!n;if(!n){var i=document.querySelector(o);i||(document.querySelector('[data-tooltip="Settings"]').click(),await t(10),i=document.querySelector(o)),i.click(),await t(250),n=document.querySelector(c)}n.click(),r&&(await t(50),document.querySelector('[data-tooltip="Save & close"]').click())})(e.matches?"black":"white")};e.addEventListener("change",t),window.__themeListenerUnsubscribe=()=>{e.removeEventListener("change",t)}})() |
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
export const partition = <T>( | |
arr: T[], | |
iteratee: (value: T, index: number, array: T[]) => any | |
) => | |
arr.reduce( | |
(result: [T[], T[]], value, index, array) => ( | |
result[+!iteratee(value, index, array)].push(value), result | |
), | |
[[], []] | |
) |
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
// https://github.com/forivall/dotfiles/blob/osx/userscripts/github-review-keyboard-shortcuts.js | |
/* global document */ | |
;(() => { | |
/** | |
* @param {{[key: string]: (ev: KeyboardEvent) => any}} handlers | |
* @returns {(event: KeyboardEvent) => any} | |
*/ | |
const reviewKeyboardHandler = (handlers) => (event) => { | |
if (!document.location.pathname.endsWith('/files')) return | |
const ae = document.activeElement |
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
/** | |
* For vscode globs that can't just do `!`, but do have negative char classes | |
* | |
* turn `test` into `{[^t]*,?[^e]*,??[^s]*,???[^t]*}` | |
* `{[^t]*,?{,[^r]*,?{,[^a]*,?[^p]*}}}` | |
* | |
* two directories need to be excluded, the following would be needed: | |
* (ex. for negating 'test' or 'glob') | |
* | |
* `{[^tg]*,?[^el]*,??[^so]*,???[^tb]*,te{sb,ob,ot},t{ls,lo,eo}t,{tl,ge,gl}st,gl{ot,sb,st},g{es,ls,eo}b,{ge,tl,te}ob` |
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
// the .js version must be checked in, as it is needed before anything is installed. | |
// this file can _not_ use any non-core modules or access any external files. | |
export {}; | |
// https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-fslib/sources/path.ts#L10 | |
type NativePath = string & { __pathType?: 0 | 2 }; | |
// https://github.com/yarnpkg/berry/blob/master/packages/plugin-exec/sources/ExecFetcher.ts#L9 | |
/** | |
* Contains various useful details about the execution context. |
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
document.querySelectorAll('h1,h2,h3,h4,h5,h6').forEach((h) => { | |
var e = h.nextElementSibling, a = [h], d | |
e && a.push(e) | |
while (e && /H[0-6]/.test(e.tagName)) (e = e.nextElementSibling) && a.push(e) | |
if (a.length === 1) return | |
d = document.createElement('div') | |
d.style.display = 'inline-block' | |
h.replaceWith(d) | |
d.append(...a) | |
}) |
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
import React from 'react'; | |
export function fixSubRoutes( | |
routeElement: React.ReactElement<React.PropsWithChildren<{ path?: string }>>, | |
props?: { path?: string } | |
) { | |
const parentRoute = routeElement.props.path; | |
return React.cloneElement( | |
routeElement, | |
props, | |
...React.Children.toArray(routeElement.props.children).map( |