This file contains hidden or 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 writeJoke = async (joke, path) => { | |
const filehandle = await fs.open(path, 'w'); | |
try { | |
return await filehandle.write(joke); | |
} finally { | |
await filehandle.close(); | |
} | |
}; | |
(async () => { | |
const [j1, j2] = await gfunction(); |
This file contains hidden or 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 Stack Experiment Off | |
// @author CertainPerformance | |
// @description Turns off the voting experiment - shows true vote totals on pageload and after voting | |
// @description https://meta.stackoverflow.com/questions/390178/new-popup-message-when-voting-on-a-question | |
// @version 1.1.1 | |
// @include /^https://stackoverflow\.com/questions/(?:\d+|tagged|search)/ | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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 reference: | |
// https://stackoverflow.com/questions/54776759/how-to-avoid-accidentally-implicitly-referring-to-properties-on-the-global-objec | |
const fakeWindow = (() => { | |
// Declare Object and ReferenceError as variable names in this scope | |
// since implicit references to them on window will eventually fail during the below loop | |
const { Object, ReferenceError } = window; | |
const fakeWindow = Object.create(Object.getPrototypeOf(window)); | |
const descriptors = Object.getOwnPropertyNames(window) | |
.reduce((a, propName) => { |