Skip to content

Instantly share code, notes, and snippets.

View maxdemarzi's full-sized avatar
🏠
Working from home

Max De Marzi maxdemarzi

🏠
Working from home
View GitHub Profile
@maxdemarzi
maxdemarzi / GlobalUnique.java
Created December 21, 2013 15:08
Test running for 60 seconds, after 2x warm-ups: Using OpenBitSet: 265 requests, 4/s, mean 1831ms. Using HashSet: 173 requests, 3/s, mean 2807ms.
/**
* Copyright (c) 2002-2013 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@maxdemarzi
maxdemarzi / gist:6286700
Created August 20, 2013 20:17
Size + Time Rabbit MQ Accumulator
require 'bunny'
require 'timers'
TIME_TO_WAIT=3
MAX_BUFFER=3
# Setup Timers
timers = Timers.new
@three_second_timer = timers.every(3) { puts "***********triggered by timer*********" ; process_messages }
require 'bunny'
connection = Bunny.new
connection.start
channel = connection.create_channel
channel.prefetch(3)
exchange = channel.direct("moar")
@maxdemarzi
maxdemarzi / Gemfile
Created March 21, 2012 18:02
Break Lucene - Public
source 'http://rubygems.org'
gem 'rake'
gem 'neography'
@maxdemarzi
maxdemarzi / anees_haider.rb
Created November 22, 2010 07:00
Test Traversal
#<- "POST /db/data/node/6227/traverse/node HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nHost: localhost:7474\r\nContent-Length: 567\r\n\r\n"
#<- "{\"order\":\"breadth first\",\"uniqueness\":\"node global\",\"relationships\":{\"type\":\"linked\",\"direction\":\"out\"},\"prune evaluator\":{\"language\":\"javascript\",\"body\":\"position.startNode().hasProperty('NODE_LEVEL') && position.startNode().getProperty('NODE_LEVEL')==5 && position.startNode().getId()!=6227;\"},\"return filter\":{\"language\":\"javascript\",\"body\":\"position.endNode().hasProperty('NODE_LEVEL') && position.endNode().getProperty('NODE_LEVEL')==5;\"}}"
require 'rubygems'
require 'neography'
# require 'net-http-spy'
# Net::HTTP.http_logger_options = {:verbose => true} # see everything