Skip to content

Instantly share code, notes, and snippets.

🛋
...

Sergey Avseyev avsej

🛋
...
Block or report user

Report or block avsej

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:01a1cdace53b5eb7c858f511c41d5589
/* -*- 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"
View gist:3006da6863f97810d31aa1d1c5137e51
#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;
View gist:0429ab57487e9f05d2e2498e92a60b56
#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;
View fix-macro-couchbase-2.2.4.patch
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();
View gist:07b5710a8db5151d57e3
### 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:
View test.rb
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"
View test.rb
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
View test.rb
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
View *scratch*
;; 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.
View *scratch*
;; 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.
You can’t perform that action at this time.