Skip to content

Instantly share code, notes, and snippets.

@bow-fujita
bow-fujita / tokyotyrant-fix-unix-socket.patch
Created March 19, 2015 08:09
Patch for TokyoTyrant to fix UNIX socket issue.
diff -urN tokyotyrant-1.1.41.orig/ttutil.c tokyotyrant-1.1.41/ttutil.c
--- tokyotyrant-1.1.41.orig/ttutil.c 2010-08-04 23:24:33.000000000 -0700
+++ tokyotyrant-1.1.41/ttutil.c 2015-03-19 01:04:27.000000000 -0700
@@ -24,7 +24,6 @@
*************************************************************************************************/
-#define SOCKPATHBUFSIZ 108 // size of a socket path buffer
#define SOCKRCVTIMEO 0.25 // timeout of the recv call of socket
#define SOCKSNDTIMEO 0.25 // timeout of the send call of socket
@bow-fujita
bow-fujita / jqm-glyphicons.css
Last active August 23, 2017 18:30
Apply Bootstrap's Glyphicons as .ui-icon-glyphicon-* in jQueryMobile
@font-face {
font-family: 'Glyphicons Halflings';
src: url('fonts/glyphicons-halflings-regular.eot');
src: url('fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('fonts/glyphicons-halflings-regular.woff') format('woff'), url('fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
.ui-icon-glyphicon-asterisk:after,
.ui-nosvg .ui-icon-glyphicon-asterisk:after {
color:#fff;
font-size:14px;
@bow-fujita
bow-fujita / Makefile
Created August 15, 2012 06:45
Makefile for building a "Hello, world!" OpenCV app
SHELL := /bin/bash
.SUFFIXES:
MODULE := $(shell basename $(PWD))
INC_DIR := /opt/local/include
LIB_DIR := /opt/local/lib
OPENCV_VERSION := 2.4
OPENCV_LIB := core highgui
@bow-fujita
bow-fujita / json_write.cpp
Created August 7, 2012 07:11
How to encode UTF-8 string in JSON
#include <iostream>
#include <stdexcept>
#include <vector>
#include <string>
#include <cstring>
#include <locale>
#include <boost/property_tree/json_parser.hpp>
using namespace std;
class CodeCvt