Skip to content

Instantly share code, notes, and snippets.

View berry's full-sized avatar

Berry berry

View GitHub Profile

Keybase proof

I hereby claim:

  • I am berry on github.
  • I am berryg (https://keybase.io/berryg) on keybase.
  • I have a public key whose fingerprint is 4BE7 F346 F8AE B09C 68CF 88E3 93F2 1337 D15A 04CF

To claim this, I am signing this object:

<script type="text/javascript">
const address = 'localhost:3333';
const username = 'user1';
const password = '';
const channel = 'test'
const ipfs = new window.Ipfs();
const logger = Logger.create("orbit-db autorga", { color: Logger.Colors.Green, showTimestamp: true, showLevel: false })
const orbit = OrbitDB.connect(address, username, password, ipfs);
const putget = (key,value) => {
@berry
berry / zmq-test.py
Created July 10, 2010 16:45
0MQ request response test against a Redis server
# Code below doesn't work. It keeps waiting for a response.
import zmq
ctx = zmq.Context()
s = ctx.socket(zmq.REQ)
# On port 6379 there is a basic REDIS server
s.connect("tcp://127.0.0.1:6379")
#
# redis-geo-test.py
# Redis proof-of-concept for geo searching
#
# Created by Berry Groenendijk on 2010-04-30.
# Copyright 2010 - personal project. All rights reserved.
#
import redis
from random import Random
#<Keyspace Name="MapData">
# <ColumnFamily CompareWith="BytesType" Name="Points"/>
# <ColumnFamily CompareWith="LongType" Name="Lons"/>
#</Keyspace>
import struct
import binascii
from lazyboy import *
from lazyboy.key import Key
# Josephus problem
# See: http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/
#
# Quoting from the post linked to above :
#
# Flavius Josephus was a roman historian of Jewish origin. During the
# Jewish-Roman wars of the first century AD, he was in a cave with fellow
# soldiers, 40 men in all, surrounded by enemy Roman troops. They decided to
# commit suicide by standing in a ring and counting off each third man. Each man
# so designated was to commit suicide...Josephus, not wanting to die, managed to
# Testing IO with pypy-c-jit
import sys
import datetime
def readfile(filename):
f = open(filename, 'r')
html = f.read()
f.close()