Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am memosanchez on github.
* I am memo (https://keybase.io/memo) on keybase.
* I have a public key whose fingerprint is F759 623E 98CE 4227 8F22 9CE7 8CF7 50E9 C97C 4323
To claim this, I am signing this object:
class myComponent extends React.Component {
state = {
data: null,
};
async componentDidMount() {
const res = await fetch('/api/endpoint');
const dataFromApi = res.json();
this.setState({ data: dataFromApi });
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils make
sudo apt-get install git-core
# download the Node source, compile and install it
cd /opt
git clone https://github.com/joyent/node.git
cd node
git checkout v0.6
./configure
{
graphitePort: 2003,
graphiteHost: "localhost",
port: 8125,
backends: [ "./backends/graphite" ]
}
@memosanchez
memosanchez / gist:6243333
Created August 15, 2013 18:23
npm style isn't always great
var server = { host: process.env.ES_HOST || 'localhost'
, port: process.env.ES_PORT || 9200
, secure: false
, auth: { username: process.env.ES_USERNAME
, password: process.env.ES_PASSWORD
}
}
var serverOptions = {
host: process.env.ES_HOST,