Skip to content

Instantly share code, notes, and snippets.

# -*- mode: ruby -*-
# vi: set ft=ruby :
#In case script issues, run this before any attempt : find . -type f -print0 | xargs -0 dos2unix
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.network "private_network", type: "dhcp"
@lighta
lighta / pseudo_process.js
Created April 22, 2015 19:45
pseudo_process of mysql to es syncer
function format_result(results,datas,callback){
json = syncCall(foo);
datas.push(json);
callback();
return;
}
function async_push_data_to_x(datas){
...
@lighta
lighta / nodesync.js
Last active September 12, 2018 11:52
Nodejs converter from mysql to elasticsearch node
// CodeStyle :
// fu.. those stupid implicite call, please use semicolon, return and everything to avoid confusion
var parser = require('xml2json');
var async = require('async');
var fs = require('fs');
var process = require('process');
var moment = require('moment');
var mysql_singleton = require('./mysql_singleton');
@lighta
lighta / query
Created April 16, 2015 14:55
es_nested_query
{
"_source": [
"name",
"attribs"
],
"query": {
"nested": {
"path": "attribs",
"query": {
"bool": {