Skip to content

Instantly share code, notes, and snippets.

View avsej's full-sized avatar

Sergey Avseyev avsej

View GitHub Profile
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include <stdio.h>
#include <libcouchbase/couchbase.h>
#include <libcouchbase/api3.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#ifdef _WIN32
#define PRIu64 "I64u"
#include <iostream>
#include <thread>
#include "libcouchbase/couchbase.h"
static void opCallback(lcb_t instance, int cbtype, const lcb_RESPBASE *rb) {
if (rb->rc != LCB_SUCCESS) {
fprintf(stderr, "%s\n", lcb_strerror(NULL, rb->rc));
} else {
if (cbtype == LCB_CALLBACK_GET) {
const lcb_RESPGET *rg = (const lcb_RESPGET *)rb;
#include <iostream>
#include <thread>
#include "libcouchbase/couchbase.h"
static void opCallback(lcb_t instance, int cbtype, const lcb_RESPBASE *rb) {
if (rb->rc != LCB_SUCCESS) {
fprintf(stderr, "%s\n", lcb_strerror(NULL, rb->rc));
} else {
if (cbtype == LCB_CALLBACK_GET) {
const lcb_RESPGET *rg = (const lcb_RESPGET *)rb;
diff -Nru couchbase-2.2.4/couchbase.c couchbase-2.2.4.orig/couchbase.c
--- couchbase-2.2.4/couchbase.c 2016-12-26 21:29:05.000000000 +0200
+++ couchbase-2.2.4.orig/couchbase.c 2017-02-01 19:33:27.771468268 +0200
@@ -94,7 +94,7 @@
static void php_extname_init_globals(zend_couchbase_globals *couchbase_globals)
{
-#ifdef COMPILE_DL_COUCHBASE && defined(ZTS)
+#if defined(COMPILE_DL_COUCHBASE) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE();
### Keybase proof
I hereby claim:
* I am avsej on github.
* I am avsej (https://keybase.io/avsej) on keybase.
* I have a public key whose fingerprint is C904 2380 904C 3CA2 8D7C EED4 B8C5 2427 872C F7D3
To claim this, I am signing this object:
x = Object.new
def x.instance_variable_get(*)
return nil
end
x.instance_variable_set(:@foo, 'x')
x.instance_variable_get(:@foo) # => nil
x.instance_eval("@foo") # => "x"
@avsej
avsej / test.rb
Last active August 29, 2015 14:00
select
require 'active_record'
require 'sqlite3'
require 'squeel'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'test.db')
ActiveRecord::Base.connection.tap do |c| # !> `&' interpreted as argument prefix
c.create_table(:posts, force: true) do |t| # !> method redefined; discarding old eval_scope
t.string :title
t.text :body
require 'active_record'
require 'sqlite3'
require 'squeel'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'test.db')
ActiveRecord::Base.connection.tap do |c| # !> `&' interpreted as argument prefix
c.create_table(:posts, force: true) do |t| # !> method redefined; discarding old eval_scope
t.string :title
t.text :body
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
@avsej
avsej / *scratch*
Created April 22, 2014 13:15
test
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.