Skip to content

Instantly share code, notes, and snippets.

@little-brother
little-brother / main.c
Last active August 8, 2021 17:45
SQLite query watcher
/*
Build
gcc.exe -Wall -O2 -c main.c -o obj\main.o
gcc.exe -Wall -O2 -c sqlite3.c -o obj\sqlite3.o
gcc.exe -o watcher.exe obj\main.o obj\sqlite3.o -s
Usage example
watcher -d "D:/my.sqlite" -q "select * from t order by 1 desc limit 10" - t 2
*/
#include <stdbool.h>
@little-brother
little-brother / Generate Excel file
Last active August 17, 2021 08:56
How to create one-sheet xlsx file without any code dependencies by template
// https://habr.com/ru/post/572684/
// template.xslx - https://github.com/little-brother/sqlite-gui/blob/master/resources/template.xlsx
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const unsigned int crc32_tab[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
@little-brother
little-brother / undark
Last active September 6, 2021 18:17
Undark (fork) - SQLite deleted and corrupted data recovery tool
// Forked from http://pldaniels.com/undark/
// Build: gcc undark.c -o undark.exe -lws2_32 -s
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>