Skip to content

Instantly share code, notes, and snippets.

@deltheil
deltheil / torch-svm.md
Created November 28, 2014 16:13
A quick'n'dirty work around to install koraykv/torch-svm

torch-svm

Here's a quick'n'dirty work around to install torch-svm:

Clone the repo

git clone git@github.com:koraykv/torch-svm.git && cd torch-svm
@deltheil
deltheil / luajit-valgrind.md
Created July 16, 2014 08:24
LuaJIT + Valgrind (linux x64)
  1. use Valgrind 3.8.1 since 3.9.0 broke LuaJIT
  2. build LuaJIT with the following options:
diff --git a/src/Makefile b/src/Makefile
index c558003..39676b8 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -57,7 +57,7 @@ CCOPT_mips=
 #
@deltheil
deltheil / build-cfsm.sh
Last active August 29, 2015 14:03
cfsm - Finite State Machine compiler
# -------
# cfsm
# -------
# see: http://www.mindrot.org/projects/cfsm/
# Build (tested on Mac OS X 10.9.3)
cvs -d :ext:anoncvs@anoncvs.mindrot.org:/cvs checkout cfsm mtemplate
make -C mtemplate
make -C cfsm CPPFLAGS='-D_FORTIFY_SOURCE=0'
mkdir /usr/local/share/cfsm
@deltheil
deltheil / qb.sh
Last active January 3, 2016 23:49
Find circles centers with QuickBlob (a C library for blob detection)
# Get QuickBlob here: https://github.com/keenerd/quickblob
#
# QuickBlob comes as a C library. To use it within your own
# program you need to implement a few functions:
# https://github.com/keenerd/quickblob/blob/a2502b0/quickblob.h#L52-L72
#
# QuickBlob comes with a command-line tool that depends on DevIL library
# but you are free to use your own image processor while integrating the
# library into your program.
cd /path/to/quickblob
@deltheil
deltheil / tcbdb.md
Last active December 29, 2015 19:29
A (somewhat) detailed description of Tokyo Cabinet B+tree database.

Tokyo Cabinet B+ tree database

Overview

The Tokyo Cabinet B+tree database (a.k.a TCBDB) is implemented on-top of the hash database (TCHDB) that acts as the persistence layer.

Note: the same occurs with Tokyo table database (TCTDB) which is also a wrapper around the TCHDB (the table database can be thought as a document oriented database with querying capabilities).

@deltheil
deltheil / port.c
Last active June 11, 2017 14:19
C: character string to uint16_t conversion (see http://stackoverflow.com/q/20019786/1688185)
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h> /* strtoumax */
#include <stdbool.h>
#include <errno.h>
static bool str_to_uint16(const char *str, uint16_t *res);
int
main(int argc, char *argv[])

Never Heard Of It

tl;dr

I suffer from a nagging, constant twitch to check the latest tech headlines.

On good mornings, I have time to read my RSS feeds. Most mornings, however,

@deltheil
deltheil / md5deep.sh
Last active October 22, 2016 21:28
Files and directory comparison with md5deep matching mode (see http://md5deep.sourceforge.net/start-md5deep.html#match).
# Create a reference folder with some data
mkdir foo
echo "hey" > foo/A.txt
echo "scm" > foo/B.txt
echo "git" > foo/C.txt
# Generate the list of hashes for each file
# -b = bare mode (strips any leading directory
# information from displayed filenames)
md5deep -b foo/* > hashes.txt
@deltheil
deltheil / colour.rb
Created October 10, 2013 12:34
Use Ohm to illustrate how to manage an index within Redis. See http://stackoverflow.com/a/19289987/1688185.
require "ohm"
class Doc < Ohm::Model
attribute :colour
index :colour
end
Doc.create(:colour => "red")
Doc.create(:colour => "green")
Doc.create(:colour => "red")
@deltheil
deltheil / libcurl_dns.md
Last active March 15, 2019 00:54
libcurl options to control DNS lookup (cache, timeout, resolving time, etc). The short URL for this page is: http://git.io/libcurl-dns.

Easy handle interface

Options

Info