Skip to content

Instantly share code, notes, and snippets.

View Hydrock's full-sized avatar

Alex Vechkanov Hydrock

View GitHub Profile
import React, { unstable_Profiler as Profiler } from 'react';
...
const Profiler = React.unstable_Profiler;
import React, { Component, unstable_Profiler as Profiler } from "react";
import { render } from "react-dom";
class ComponentWithProfiling extends Component {
state = {
count: 0
};
logProfile = (id, phase, actualTime, baseTime, startTime, commitTime) => {
console.log(`${id}'s ${phase} phase:`);
{
"scripts": {
"build": "cross-env NODE_ENV=production node app.js"
}
}
set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\user\AppData\Roaming
.
.
.
windir=C:\Windows
@Hydrock
Hydrock / .env
Created June 15, 2018 06:56
.env file example
MYAPIKEY=ndsvn2g86nsb9hsg
const myAPIKey = process.env.MYAPIKEY;
const url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey;
const result = fetch(url);
node
> console.log(process.env)
{ GIT_PS1_SHOWDIRTYSTATE: '1',
NVM_RC_VERSION: '',
...
...
...
_: '/usr/local/bin/node',
__CF_USER_TEXT_ENCODING: '0x1F5:0x0:0x0' }
const myAPIKey = 'ndsvn2g86nsb9hsg';
const url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey;
const result = fetch(url);
var request = require('request-promise');
var main = function() {
var myAPIKey = process.env.MYAPIKEY;
var url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey;
return request(url);
};
var request = require('request-promise');
var main = function() {
var myAPIKey = 'ndsvn2g8dnsb9hsg';
var url = 'https://externalapi.service.com/v1/query?key=' + myAPIKey;
return request(url);
};