Skip to content

Instantly share code, notes, and snippets.

View robert-zaremba's full-sized avatar

Robert Zaremba robert-zaremba

View GitHub Profile
@robert-zaremba
robert-zaremba / benchmark_len_test.go
Created January 27, 2021 16:20
Go: benchmark len
package pkg
import "testing"
var a []int
var N = 200000000
func init() {
l := 10000
a = make([]int, l, l)
@robert-zaremba
robert-zaremba / keybase.md
Created March 12, 2018 23:59
Keybase proof

Keybase proof

I hereby claim:

  • I am robert-zaremba on github.
  • I am robert_zaremba (https://keybase.io/robert_zaremba) on keybase.
  • I have a public key ASCnd30tlnxWvIH1Ntou7aVdoR-MduQi-j_fKtthCDCiNQo

To claim this, I am signing this object:

@robert-zaremba
robert-zaremba / values.go
Last active January 3, 2016 04:49
Test gorethinkdb driver for a sum of values in RethinkDB table.
package main
import (
r "github.com/dancannon/gorethink"
"log"
)
type valT struct {
V float64
}
@robert-zaremba
robert-zaremba / gist:8315182
Last active January 2, 2016 14:09
A code which shows 2 different evaluation of RethinkDB ReQL filter which is suppose to return two same data, but it doesn't.
import calendar
from datetime import datetime as dt
import rethinkdb as r
r.connect( "localhost", 28015).repl()
table = r.db('test').table('test')
print table.delete().run()
docs = [{'t': i} for i in range(20)]
print table.insert(docs).run()
start, end = 10, 12
// RethinkDB utilities functions for gorethink driver
package rdbu
import (
"fmt"
rdb "github.com/dancannon/gorethink"
"reflect"
)
@robert-zaremba
robert-zaremba / app.py
Created January 15, 2013 18:17
This application presents mongotor bug
import tornado.web
from tornado import gen
from mongotor.database import Database
from bson import ObjectId
class Handler(tornado.web.RequestHandler):
def initialize(self):
self.db = Database.connect('localhost:27017', 'regisys')
@robert-zaremba
robert-zaremba / connection_test.py
Created June 22, 2011 13:13
Rpyc ssl connection bug. Files presenting the issue.
# Author: Robert Zaremba
# Date: 2011.06.22
# This is the code to present rpyc bug
# The bug comes when one wants to manage 1017 sequenced connections to rpyc.utils.server.ThreadedServer with SSL Authenticator.
# the errors are:
# ssl.SSLError: [Errno 8] _ssl.c:499: EOF occurred in violation of protocol trying 1016 connection request
# or ssl.SSLError: [Errno 185090050] _ssl.c:336: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib trying 1017 connection request
#
# The code below contains ssl_connect function with bugfix to CERT_REQIURED flag
# so the ssl certificate is required now.