This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'pacer' | |
graph = Pacer.tg | |
c1 = graph.create_vertex(name: 'Concept 1') | |
c2 = graph.create_vertex(name: 'Concept 2') | |
c2a = graph.create_vertex(name: 'Concept 2a') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'pacer' | |
require 'pacer-neo4j' | |
#graph = Pacer.tg | |
graph = Pacer.neo4j('/tmp/test-neo4j') | |
c1 = graph.create_vertex(name: 'Concept 1') | |
c2 = graph.create_vertex(name: 'Concept 2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Allows you to specify events on the data tied to the view in the same way | |
// that you can specify dom events: | |
// | |
// dataEvents: { | |
// instanceName: { | |
// 'change:name': 'mothed', | |
// delete: 'otherMethod' | |
// }, ... | |
// } | |
registerDataEvents: function(unbind) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaClass.java_send :new, [java.lang.String[]], [].to_java(:string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dw:jruby-1.6.3:~/dev/graph $ gem install pacer-rexster | |
Fetching: pacer-rexster-1.0.0-jruby.gem (100%) | |
Successfully installed pacer-rexster-1.0.0-java | |
1 gem installed | |
Building YARD (yri) index for pacer-rexster-1.0.0-java... | |
dw:jruby-1.6.3:~/dev/graph $ pry | |
pry(main)> require 'pacer-rexster' | |
=> true | |
pry(main)> g = Pacer.rexster 'http://localhost:8182/gratefulgraph' | |
=> #<RexsterGraph> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup: | |
def setup_graph | |
g = Pacer.tg | |
person = g.create_vertex type: 'person' | |
print '.' | |
1000.times { g.create_vertex type: 'person' } | |
print '.' | |
g.v.each { |v| v.add_edges_to :friend, g.v.random(rand(100)) } | |
print '.' | |
1000.times { g.create_vertex :type => 'product' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[33] pry(main)> { a: { b: { c: '' } } } | |
1 2 3{ | |
:a => { | |
:b => { | |
:c => "" | |
} | |
} | |
} | |
[34] pry(main)> ModelClass | |
2 4 6 8 8 10 11 9 10 8 6 10 8 12 11 13 13 18 21 23 23 26 28 30 29 28 30 29 28 30 29 28 26 28 30 26 28 30 26 26 28 30 28 30 30 26 25 27 29 28 25 27 29 27 30 32 34 33 32 34 33 32 32 32 34 33 32 34 33 32 34 33 32 34 33 30 33 32 33 32 30 32 34 32 34 32 34 32 34 32 34 32 34 29 31 33 32 31 33 32 31 31 31 33 32 31 33 32 31 33 32 31 33 32 29 32 31 32 31 29 31 33 31 33 31 33 31 33 31 33 31 33 27 30 32 34 35 33 34 32 34 33 32 34 33 32 34 33 32 34 33 32 34 33 30 32 33 34 30 30 32 34 32 34 32 34 32 34 32 34 29 31 33 34 32 33 31 33 32 31 33 32 31 33 32 31 33 32 31 33 32 29 31 32 33 29 29 31 33 31 33 31 33 31 33 31 33 27 30 32 34 35 33 34 30 32 33 34 30 29 31 33 34 32 33 29 31 32 33 29 27 30 32 34 35 33 34 32 34 35 33 34 30 32 33 34 32 33 34 30 29 31 33 34 32 33 31 33 34 32 33 29 31 32 33 31 32 33 29 27 30 29 27 30 32 34 35 33 34 32 34 35 33 34 30 32 33 34 32 33 34 30 29 31 33 34 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Swimlane using d3.js</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<script type="text/javascript" src="randomData.js"></script> | |
<style> | |
.chart { | |
shape-rendering: crispEdges; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EnumerablePipe | |
def initialize(obj) | |
obj.to_enum | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'celluloid' | |
class Counter | |
include Celluloid::Worker | |
def count | |
len = rand(1000) | |
Celluloid::Actor[:min].result len | |
len | |
end |
OlderNewer