I hereby claim:
- I am mxstbr on github.
- I am mxstbr (https://keybase.io/mxstbr) on keybase.
- I have a public key whose fingerprint is DF86 64CE 0ECF A8CA F8EB 3919 DAE5 1ACA D765 65B6
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
made with esnextbin
made with esnextbin
To get syntax highlighting for ESNext (including JSX), you need to have pygments-lexer-babylon
installed:
pip install pygments pygments-lexer-babylon
Now when you run pygmentize
on a .jsx
file it'll automatically use the new lexer! 🎉
I hereby claim:
To claim this, I am signing this object:
import createLogger from 'graphql-log'; | |
let list = []; | |
const logExecutions = createLogger({ | |
logger: (name) => { | |
list.push(name); | |
fs.writeFileSync('resolvers.js', JSON.stringify(list, null, 2)); | |
}, | |
}); |
import postmark from 'postmark'; | |
const debug = require('debug')('send-email'); | |
const stringify = require('json-stringify-pretty-compact'); | |
let client; | |
if (process.env.POSTMARK_SERVER_KEY) { | |
client = new postmark.Client(process.env.POSTMARK_SERVER_KEY); | |
} else { | |
console.log( | |
'\nℹ️ POSTMARK_SERVER_KEY not provided, debug mode enabled. Will log emails instead of actually sending them.' |
First, start Chrome and open the page you want to profile:
./chrome --js-flags=”--prof” --no-sandbox http://localhost:8080/index.html
Note: This page should do things on-load, simply close Chrome once it's done
Then preprocess the biggest .log
file you get: (since the biggest one should be from the main renderer):
// @flow | |
// Turn a callback-based listener into many async iterators without buffering | |
import { $$asyncIterator } from 'iterall'; | |
type Listener = ((arg: any) => void) => Promise<any>; | |
const defaultOnError = (err: Error) => { | |
throw new Error(err); | |
}; |