Skip to content

Instantly share code, notes, and snippets.

@nexflo
nexflo / 0_reuse_code.js
Created February 1, 2014 16:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nexflo
nexflo / gist:fc2a763a408cd31f27cd
Last active April 8, 2018 23:39
Import GeoIP Elasticsearch nodeJS
/**
* First download CSV GeoLite Database here:
* http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.zip
**/
var lazy = require("lazy"),
fs = require("fs");
var elasticsearch = require('elasticsearch');
esearch = new elasticsearch.Client( {keepAlive: true, log: 'error', requestTimeout: 6000, maxSockets:100, deadTimeout: 6000});
elasticsearch.Client.apis['master'].ping.spec.requestTimeout = 6000;