Skip to content

Instantly share code, notes, and snippets.

@lighta
lighta / query
Created April 16, 2015 14:55
es_nested_query
{
"_source": [
"name",
"attribs"
],
"query": {
"nested": {
"path": "attribs",
"query": {
"bool": {
@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 / 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){
...
# -*- 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 / redmine_3.0.2_timezone
Created April 30, 2015 05:56
Redmine 3.0.2 issue on install
mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| US/Eastern | US/Eastern |
+--------------------+---------------------+
1 row in set (0.00 sec)
mysql> select now();
+---------------------+
nuget {
nuspec {
id = dwos_boost159;
version : 0.4;
title: boost159;
authors: {Dental Wings, Max Moreau};
licenseUrl: "https://en.wikipedia.org/wiki/Boost_Software_License";
projectUrl: "http://www.boost.org/";
iconUrl: "Z:\mmoreau\lib\logo\boost_logo.png";
requireLicenseAcceptance:false;
@lighta
lighta / .c
Created December 30, 2015 18:56
chclif_createnewchar_ack
int chclif_createnewchar_ack(int fd, struct char_session_data* sd,int idx){
//'Charname already exists' (-1), 'Char creation denied' (-2) and 'You are underaged' (-3)
if (idx < 0) {
WFIFOHEAD(fd,3);
WFIFOW(fd,0) = 0x6e;
/* Others I found [Ind] */
/* 0x02 = Symbols in Character Names are forbidden */
/* 0x03 = You are not elegible to open the Character Slot. */
switch (idx) {
@lighta
lighta / test_npc_callshop.txt
Created December 31, 2015 09:21
Trying pull 832
//test menu + callshop + end
prontera,153,180,5 script CallShopBug 89,{
switch(select("Open Shop", "Something", "Something2 "))
{
case 1:
callshop "someshop",1; // open shomeshop with buy list
break;
case 2:
callshop "someshop",2; // open shomeshop with sell list
break;
@lighta
lighta / devotion_722.diff
Created December 31, 2015 09:37
* cf issue #722, devotion code Move devotion check_distance to map_moveblock check, Extend battle_check_devotion and replace duplicate code with it Add skill_foundDevotionPlace meant to search for a valid place for new devotion, (small performance upd and avoid duplicate)
diff --git a/src/map/battle.c b/src/map/battle.c
index 0d87c16..1d03c01 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -313,12 +313,14 @@ int battle_delay_damage(unsigned int tick, int amotion, struct block_list *src,
sc = status_get_sc(target);
- if (sc && sc->data[SC_DEVOTION] && sc->data[SC_DEVOTION]->val1)
- d_tbl = map_id2bl(sc->data[SC_DEVOTION]->val1);
| cCalibWidthCenter.cpp(1071): warning C4081: expected ')'; found 'user-defined string literal1 ll1071'|
cCalibWidthCenter.cpp:
l1 : #include "stdafx.h"
l1071 : TODO("hange ths magic number by a macro")
stdafx.h:
#define TODO(x) __pragma(message(__FILE__"("STR_EXPAND(__LINE__)") : TODO : "STR_EXPAND(x)))