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 table = document.querySelector( | |
"#dashboard > div.ContentWrapper.ContentWrapper-normal.Infrastructure > div > div > div > div.col-md-3 > section > div.stl-table-wrapper.stl-rounded.stl-text-grey-900.stl-bg-white.stl-typo-display-body > table" | |
); | |
const items = Array.from(table.querySelectorAll("tr")); | |
items.map(row => { | |
if(row.textContent.includes('Latency')) return | |
const country = row.querySelector("span:nth-child(2)").textContent.trim(); | |
const latency = row | |
.querySelector(".region-response-time") |
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 dsntoString(dsn, withPassword) { | |
const { host, port, path, pass, projectId, protocol, publicKey } = dsn; | |
return ( | |
`${protocol}//${publicKey}${withPassword && pass ? `:${pass}` : ''}` + | |
`@${host}${port ? `:${port}` : ''}${path}/${projectId}` | |
); | |
} | |
function dsnFromString(str) { | |
const url = new URL(str); |
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
/* eslint-env node */ | |
// This a typescript file, so you need to run it with something that can compile it like ts-node, | |
// or you can just compile it yourself with tsc. The output of the script is logged to stdout. | |
// | |
// the workflow is to run "eslint > out.txt && ts-node blame.ts" | |
// right now, the script only picks up the author email and commit sha where the lint error | |
// was introduced - a possible improvement is to query gh's api to get the username of the person. | |
import {execSync} from 'child_process'; | |
import fs from 'fs'; |
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
// ==UserScript== | |
// @name gh notifications | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description mark githup notifications | |
// @author You | |
// @match https://github.com/notifications?query=is%3Aunread | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== |
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
// go to chrome://flags/ and enable Experimental Web Platform features flag | |
// Add a logger for LoAF entries | |
const observer = new PerformanceObserver(function(list) { | |
for (const entry of list.getEntries()) { console.log(entry) } | |
}); | |
observer.observe({type: "long-animation-frame", buffered: true}); | |
// Define a slow and fast function. The slow function here is the precise source of our performance bottleneck |
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
HTML | |
<div class="bar" data-background="10px 10px"> | |
<div class="child"></div> | |
</div> | |
<div class="bar second"> | |
<div class="child"></div> | |
</div> | |
CSS | |
.bar { |