Skip to content

Instantly share code, notes, and snippets.

# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/jessie64"
# Disable automatic box update checking.
config.vm.box_check_update = false
# Create a public network, which generally matched to bridged network.
@mytskine
mytskine / littre-daemon.sh
Created April 15, 2013 17:07
Wrapper script for running a Yesod app (xmlittre) as a daemon. start-stop-daemon starts the process, fork it in the background, and creates the PID file.
#! /bin/sh
DAEMON=xmlittre
NAME=xmlittre-web
DESC=xmlittre-web
MAINDIR=$(readlink -f `dirname "$0"`)
PIDPATH="$MAINDIR/tmp/run"
START_OPTS="--make-pidfile --background --no-close --chdir $MAINDIR"
DAEMON_OPTS="production --port 3000"
@mytskine
mytskine / ext_ICU_icu.c.patch
Last active December 14, 2015 04:29
Patch to SQLite'extension "ICU" to create collations that ignore case and accents. It adds to `icu_load_collation()` an optional third parameter that sets the collation strength (default=3).
diff --git a/icu.c b/icu.c
index ae28d70..63d26b9 100644
--- a/icu.c
+++ b/icu.c
@@ -418,10 +418,14 @@ static void icuLoadCollation(
UErrorCode status = U_ZERO_ERROR;
const char *zLocale; /* Locale identifier - (eg. "jp_JP") */
const char *zName; /* SQL Collation sequence name (eg. "japanese") */
+ int collStrength; /* Collation strength: 0..4 (default,primary..quaternary) */
UCollator *pUCollator; /* ICU library collation object */