Skip to content

Instantly share code, notes, and snippets.

View Leonidas-from-XIV's full-sized avatar

Marek Kubica Leonidas-from-XIV

View GitHub Profile
(*
ocamlbuild \
-pkg containers \
-pkg lwt \
-pkg yojson \
-pkg conduit.lwt-unix \
-pkg nocrypto \
-pkg nocrypto.unix \
-pkg websocket.lwt \
-cflags "-w A-4-40-41-42-44" \
@mike1703
mike1703 / optimize-sqlite.sh
Created October 31, 2017 07:04
finds all sqlite databases in the current folder (and subfolders) and executes sqlite3 $FILE "VACUUM;" on all databases
#!/bin/bash
find -type f \( -name "*.db" -or -name "*.sqlite" \) -print0 | while read -d $'\0' FILE
do
TYPE=`file "$FILE" | grep -i sqlite`
[ -z "$TYPE" ] && continue # this is not an sqlite db
PRESIZE=`ls -sh "$FILE" | cut -f 1 -d " "`
PRESIZEFULL=`ls -s "$FILE" | cut -f 1 -d " "`
sqlite3 "$FILE" "VACUUM;"
POSTSIZE=`ls -sh "$FILE" | cut -f 1 -d " "`
@katef
katef / hattifatteners.awk
Created October 23, 2020 22:48
hattifatteners.awk
#!/usr/bin/awk -f
function hoop(h, w) {
printf("l 0 %d ", -h);
printf("c 0 -%u, %u -%u, %u 0 ", w, w, w, w);
printf("l 0 %d", +h);
}
function hand(x, h, o, l) {
printf("<g transform='translate(%d.5 %d)'>\n", x, h);