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
var less = require('less'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var SourceMapGenerator = require('source-map').SourceMapGenerator | |
function errfn(callback) { | |
return function (err) { | |
if (err) callback.call(this, err); | |
else callback.apply(this, [].slice.apply(arguments).slice(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
wait4eth1() { | |
CNT=0 | |
until ip a show eth1 | grep -q UP | |
do | |
[ $((CNT++)) -gt 60 ] && break || sleep 1 | |
done | |
sleep 1 | |
} | |
wait4eth1 |
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
/** | |
* Simple userland CPU profiler using v8-profiler | |
* Usage: require('[path_to]/CpuProfiler').init('datadir') | |
* | |
* @module CpuProfiler | |
* @type {exports} | |
*/ | |
var fs = require('fs'); | |
var profiler = require('v8-profiler'); |
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
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |