Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Max De Marzi maxdemarzi

🏠
Working from home
Block or report user

Report or block maxdemarzi

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 anees_haider.rb
#<- "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
@maxdemarzi
maxdemarzi / Gemfile
Created Mar 21, 2012
Break Lucene - Public
View Gemfile
source 'http://rubygems.org'
gem 'rake'
gem 'neography'
View gist:6266599
require 'bunny'
connection = Bunny.new
connection.start
channel = connection.create_channel
channel.prefetch(3)
exchange = channel.direct("moar")
@maxdemarzi
maxdemarzi / gist:6286700
Created Aug 20, 2013
Size + Time Rabbit MQ Accumulator
View gist:6286700
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 }
@maxdemarzi
maxdemarzi / GlobalUnique.java
Created Dec 21, 2013
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.
View GlobalUnique.java
/**
* 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 / results
Last active Jan 4, 2016
TX 3 taking forever
View results
Maxs-MacBook-Pro-2:neography maxdemarzi$ ruby transaction_test.rb
2014-01-23 16:45:47 -0600
2014-01-23 16:45:47 -0600 start
Error deleting: Neography::NotFoundException
2014-01-23 16:45:54 -0600
all nodes deleted
2014-01-23 16:45:54 -0600
creating nodes
2014-01-23 16:45:54 -0600
2014-01-23 16:45:54 -0600 tx start
View mh_spec.rb
require 'spec_helper'
describe Neography::Rest do
before(:each) do
@neo = Neography::Rest.new
end
describe "the spatial plugin works" do
it "better work" do
node = @neo.create_node({:lat => 60.1, :lon => 15.2})
@maxdemarzi
maxdemarzi / MyService.java
Created Mar 23, 2014
NeoLove Service in Java
View MyService.java
package org.neo4j.example.unmanagedextension;
import org.codehaus.jackson.map.ObjectMapper;
import org.neo4j.cypher.javacompat.ExecutionEngine;
import org.neo4j.cypher.javacompat.ExecutionResult;
import org.neo4j.graphdb.*;
import org.neo4j.helpers.collection.IteratorUtil;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
View MyService.java
package org.neo4j.example.unmanagedextension;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import org.codehaus.jackson.map.ObjectMapper;
import org.neo4j.graphdb.*;
import org.neo4j.helpers.collection.IteratorUtil;
import javax.ws.rs.GET;
@maxdemarzi
maxdemarzi / pipeline_test.rb
Created Apr 11, 2014
Can't get more than 6000 r/s
View pipeline_test.rb
require 'net/http/pipeline'
def runit
Net::HTTP.start 'localhost', 7474 do |http|
http.pipelining = true
reqs = []
6000.times do
You can’t perform that action at this time.