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 fs = require('fs'); | |
const fetch = require('node-fetch'); | |
const GH_TOKEN = process.env.GH_TOKEN; | |
const repo = 'recurrency/frontend'; | |
if (!GH_TOKEN) { | |
console.error(`need env var GH_TOKEN`); | |
console.log(process.env); | |
process.exit(1); | |
} |
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
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
subscriptionType { name } | |
types { | |
...FullType | |
} | |
directives { | |
name |
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
/** | |
* returns a function that returns true when node matches the matcher. | |
* matchers can be built recursively. If a property of a matcher is a function, it is evaluated. | |
* | |
* @see https://astexplorer.net/ to explore how ESTree nodes are structured | |
* @example nodeMatcher({type: `Identifier`, name: `foo`})(node) | |
* | |
* @param {Obj} matcher | |
* @param {Obj} refObj | |
* @param {string} refKey |
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
enum GameState { | |
Undecided = 'undecided', | |
Draw = 'draw', | |
Player1Win = 'player1win', | |
Player2Win = 'player2win', | |
} | |
enum PlayerMark { | |
Blank = 0, | |
Player1 = 1, |
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
// @ts-ignore | |
import units from 'mdn-data/css/units.json'; | |
const widgetSample = { | |
widget: { | |
debug: `on`, | |
window: { | |
title: `Sample Konfabulator Widget`, | |
name: `main_window`, | |
dimensions: { |
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 optimizationOptions = { | |
mode: PRODUCTION ? `production` : `development`, | |
module: {rules}, | |
optimization: { | |
chunkIds: `named`, | |
moduleIds: PRODUCTION ? `hashed` : `named`, | |
usedExports: true, | |
minimize: PRODUCTION, | |
minimizer: [ | |
new TerserPlugin({ |
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 START = `start`; | |
const END = `end`; | |
export class PerfMeasure { | |
public measureName: string; | |
public started: boolean; | |
public ended: boolean; | |
constructor(measureName: string) { | |
this.measureName = measureName; |
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
/* | |
* 1) Install Chrome Split Tabs plugin: https://chrome.google.com/webstore/detail/split-tabs/mamepagkigmnpoalafajabnljlkkocbk | |
* 2) Run `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222` | |
* 3) Load two about:blank tabs side by side when chrome starts | |
* 4) Start QuickTime and record screen with the two chrome tabs side by side | |
* 5) Run `node side_by_side_urls.js`, which loads two urls in both tabs simultaneously | |
*/ | |
const puppeteer = require(`puppeteer`); | |
const fetch = require(`node-fetch`); |
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
moduleMap = {}; | |
for (const p of webpackJsonp) { | |
const modules = p[1]; | |
for (const [moduleName, moduleFn] of Object.entries(modules)) { | |
const moduleContent = moduleFn.toString(); | |
const nameParts = moduleName.split(`!`); | |
const moduleId = nameParts[nameParts.length - 1] + (nameParts.length > 1 ? `!` : ``); | |
if (!moduleMap[moduleId]) { | |
moduleMap[moduleId] = moduleContent | |
} else if (moduleMap[moduleId] !== moduleContent) { |
NewerOlder