Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mingodad's full-sized avatar

Domingo Alvarez Duarte mingodad

View GitHub Profile
@mingodad
mingodad / fts3-compress-column.diff
Created September 24, 2018 13:43
Here is the diffs to an implementation of "notcompressed" option for columns in fts3/4 in sqlite3
Index: ext/fts3/fts3.c
==================================================================
--- ext/fts3/fts3.c
+++ ext/fts3/fts3.c
@@ -851,11 +851,12 @@
}else{
zFree = zFunction = fts3QuoteId(zFunc);
}
fts3Appendf(pRc, &zRet, "docid");
for(i=0; i<p->nColumn; i++){
//{!first_name}
function fillTemplate(tpl, data)
{
local missing_keys = [];
local result = tpl.gsub(
"{!%s*(%S[^%s}]+)%s*}",
function(key)
{
if(key in data)
@mingodad
mingodad / entry.cpp.diff
Created February 20, 2018 12:09
Raiblocks dump database extension
diff --git a/rai/rai_node/entry.cpp b/rai/rai_node/entry.cpp
index f480a68..62d8900 100644
--- a/rai/rai_node/entry.cpp
+++ b/rai/rai_node/entry.cpp
@@ -121,6 +121,14 @@ int main (int argc, char * const * argv)
("debug_bootstrap_generate", "Generate bootstrap sequence of blocks")
("debug_dump_representatives", "List representatives and weights")
("debug_frontier_count", "Display the number of accounts")
+ ("debug_accounts_list", "Display the accounts list")
+ ("debug_block_info_list", "Display the block_info list")
@mingodad
mingodad / delete_update_alias.patch
Created October 9, 2017 11:43
Patch to allow table alias for delete/update on sqlite3
Index: src/delete.c
==================================================================
--- src/delete.c
+++ src/delete.c
@@ -206,10 +206,11 @@
** pTabList pWhere
*/
void sqlite3DeleteFrom(
Parse *pParse, /* The parser context */
SrcList *pTabList, /* The table from which we should delete things */
@mingodad
mingodad / gcc_go_frontend_lex.cc
Last active May 29, 2016 16:52
GCCGO __FILE__ and __LINE__ builtin constants
// Pick up an identifier.
Token
Lex::gather_identifier()
{
...
if (has_non_ascii_char)
return Token::make_identifier_token(buf, is_exported, location);
else
{
@mingodad
mingodad / main.cpp
Last active April 17, 2016 20:48
LLVM-CLANG Parser/CodeGenerator/JIT based on https://github.com/Keno/Cxx.jl
/*
#!/bin/sh
CLANGSRC=$LLVM_HOME/llvm-3.8.0.src
clang++ -fno-rtti -std=c++1y main.cpp \
-I$CLANGSRC/tools/clang/lib \
-lclangCodeGen \
-lclangFrontendTool \
-lclangFrontend \
-lclangParse \
-lclangSema \
@mingodad
mingodad / h2o-nginx-comparation-raspberry-pi-3.txt
Last active March 29, 2016 11:03
h2o and nginx performance on raspberry pi 3
Raspberry PI 3 connected through ethernet, httpress/ab/h2load/wrk runing on another computer.
-----h2o config (relevant part)
listen:
port: 8081
ssl:
certificate-file: examples/h2o/server.crt
key-file: examples/h2o/server.key
listen:
@mingodad
mingodad / sqlite-wal-test.c
Last active March 31, 2016 08:51
Test program to check how sqlite perform under heavy concurrency
/* To build it with gcc
gcc -std=c99 -O2 -g -o sqlite-wal-test \
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
-DSQLITE_USE_URI=1 \
main.c sqlite3.c -lpthread
*/
/* To run it with shell script
#!/bin/sh
data_size=256
num_threads=2
@mingodad
mingodad / shell.c.dumpdata.diff
Created August 14, 2015 10:39
Patch to add ".dumpdata" to sqlite3 command line program
--- shell.c
+++ shell.c
@@ -550,10 +550,12 @@
sqlite3_stmt *pStmt; /* Current statement if any. */
FILE *pLog; /* Write log output here */
int *aiIndent; /* Array of indents used in MODE_Explain */
int nIndent; /* Size of array aiIndent[] */
int iIndent; /* Index of current op in aiIndent[] */
+ int dumpDataOnly; /*when dump a database exclude schema */
+ int doStartTransaction; /* when dumping schema only before first record output "BEGIN;" */
@mingodad
mingodad / sqlite3_trace_v2.diff
Created August 14, 2015 10:34
Patch to add sqlite3_trace_v2 function that only trace statements that modify the database
diff -urB sqlite-src-3081101/src/loadext.c sqlite-src-3081101-2/src/loadext.c
--- sqlite-src-3081101/src/loadext.c 2015-07-29 21:06:55.000000000 +0100
+++ sqlite-src-3081101-2/src/loadext.c 2015-08-14 11:07:01.779944573 +0100
@@ -94,6 +94,7 @@
#ifdef SQLITE_OMIT_TRACE
# define sqlite3_profile 0
# define sqlite3_trace 0
+# define sqlite3_trace_v2 0
#endif