Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)
$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
https://www.netlify.com/blog/2018/08/23/how-to-easily-visualize-a-projects-dependency-graph-with-dependency-cruiser/ | |
npm i -g dependency-cruiser | |
brew install graphviz | |
depcruise --exclude "^node_modules" --output-type dot src | dot -T svg > dependencygraph.svg | |
import { useHistory } from 'react-router-dom'; | |
export const withRouter = (Component) => { | |
const Wrapper = (props) => { | |
const history = useHistory(); | |
return ( | |
<Component | |
history={history} | |
{...props} |
const { json, send } = require("micro"); | |
const cors = require("cors"); | |
module.exports = async (req, res) => { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header( | |
"Access-Control-Allow-Headers", | |
"Origin, X-Requested-With, Content-Type, Accept" | |
); | |
const body = await json(req); |
Inspired by: https://stackoverflow.com/questions/46408673/docker-17-06-ce-default-container-memory-limit-on-shared-host-resources/46557336#46557336 |
import { createConnection, getConnection, Entity, getRepository } from "typeorm"; | |
import { PrimaryGeneratedColumn, Column } from "typeorm"; | |
@Entity() | |
export class MyEntity { | |
@PrimaryGeneratedColumn() | |
id?: number; | |
@Column() | |
name?: string; |
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
React 16.4 will introduce a new Profiler
component (initially exported as React.unstable_Profiler
) for collecting render timing information in order to measure the "cost" of rendering for both sync and async modes.
Profiler
timing metrics are significantly faster than those built around the User Timing API, and as such we plan to provide a production+profiling bundle in the future. (The initial release will only log timing information in DEV mode, although the component will still render its children- without timings- in production mode.)
Profiler
can be declared anywhere within a React tree to measure the cost of rendering that portion of the tree. For example, a Navigation
component and its descendants:
let isRefreshing = false; | |
let refreshSubscribers = []; | |
const instance = axios.create({ | |
baseURL: Config.API_URL, | |
}); | |
instance.interceptors.response.use(response => { | |
return response; | |
}, error => { |