Skip to content

Instantly share code, notes, and snippets.

View rtsisyk's full-sized avatar

Roman Tsisyk rtsisyk

  • London, United Kingdom
View GitHub Profile
@rtsisyk
rtsisyk / gcc-4.7-debian-objcxx-bug.mm
Created January 18, 2013 15:07
GCC 4.7 on Debian does not compile simple Objective C++ test
#include <stdio.h>
#include <stdlib.h>
#import <objc/runtime.h>
#include <assert.h>
@interface Object
{
Class isa;
}
@rtsisyk
rtsisyk / _tarantool_js.md
Last active December 12, 2015 02:58
Tarantool/BOX + JavaScript HOWTO

Tarantool/Box + JavaScript HOWTO

Feature Stability: early alpha

Tarantool/Box is an in-memory database designed to store the most volatile and highly accessible web content. Tarantool/Box has been extensively used in production since 2009. It's open source, BSD licensed.

http://tarantool.org/

Installation

@rtsisyk
rtsisyk / key-16-val-100-500k-random.txt
Created April 24, 2013 14:38
LevelDB vs TokuKV vs KyotoCabinet vs BerkeleyDB vs NessDB
Key Len: 16
Val Len: 100
Count: 500000
----
LevelDB PUT:
Min latency : 0.957982 * 1e-6 sec/op
Avg latency : 9.486168 * 1e-6 sec/op
Max latency : 83533.152938 * 1e-6 sec/op
@rtsisyk
rtsisyk / tarantool-gentoo-overlay-howto.txt
Created May 15, 2013 18:58
tarantool-gentoo-overlay
home layman # diff -U4 /etc/layman/layman.cfg.orig /etc/layman/layman.cfg
--- /etc/layman/layman.cfg.orig 2013-05-15 22:56:42.498473444 +0400
+++ /etc/layman/layman.cfg 2013-05-15 22:54:17.738605272 +0400
@@ -37,8 +37,9 @@
# http://mydomain.org/my-layman-list.xml
# file:///var/lib/layman/my-list.xml
overlays : http://www.gentoo.org/proj/en/overlays/repositories.xml
+ https://raw.github.com/rtsisyk/tarantool-gentoo-overlay/master/overlay.xml
Package: *
Pin: release n=wheezy
Pin-Priority: 600
Package: *
Pin: release n=sid
Pin-Priority: 100
Package: *
Pin: release a=experimental
@rtsisyk
rtsisyk / gcc-4.7-gnustep-libobjc2-bug.m
Last active December 17, 2015 16:59
GCC 4.7 libobjc2 bug
/* compile with
* gcc -std=gnu99 -pthread -fobjc-exceptions -O0 bug.m -o bug \
* ../third_party/libobjc/libobjc.a
* Target: x86_64-linux-gnu
* gcc version 4.7.2 (Debian 4.7.2-5)
*/
#include <stdlib.h>
#include <stdio.h>
/* Compile with: gcc gcc-objective-c-exceptions.m -fobjc-exceptions -o test -lobjc */
#include <stdio.h>
#include <stdlib.h>
#import <objc/runtime.h>
@interface Object {
Class isa;
@rtsisyk
rtsisyk / _tarantool-gentoo.log
Last active December 18, 2015 18:29
Tarantool Gentoo Example
home src # layman -S
* Fetching remote list,...
* Remote list already up to date: http://www.gentoo.org/proj/en/overlays/repositories.xml
* Last-modified: Wed, 19 Jun 2013 12:00:02 GMT
* Fetching new list... https://raw.github.com/rtsisyk/tarantool-gentoo-overlay/master/overlay.xml
* Last-modified: Thu, 20 Jun 2013 19:42:08 GMT
* Fetch Ok
* Syncing selected overlays,...
@rtsisyk
rtsisyk / luajit-ffi-pushcdata.c
Created July 29, 2013 09:49
An example how to work with CDATA (LuaJIT FFI) objects using lua_State
void *
luaL_pushcdata(struct lua_State *L, uint32_t ctypeid, uint32_t size)
{
/*
* ctypeid is actually has CTypeID type.
* CTypeId is defined somewhere inside luajit's internal headers
* which should not be included in init.h header.
*/
static_assert(sizeof(ctypeid) == sizeof(CTypeID),
@rtsisyk
rtsisyk / main.cc
Created July 30, 2013 06:21
Lua/C API + string vs Lua/C API + cdata vs LuaJIT FFI
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include <lj_obj.h>
#include <lj_ctype.h>
#include <lj_cdata.h>
#include <lj_cconv.h>
#include <lj_state.h>
}