Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I like turtles!

Jannis Hermanns jayniz

💭
I like turtles!
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jayniz on github.
  • I am jannis (https://keybase.io/jannis) on keybase.
  • I have a public key ASD9PibKRAXJiUb5qH8tzjOEnOxmg5_ndgzfGhy-kTKkbQo

To claim this, I am signing this object:

View broken-json-pointer.rb
require 'json'
require 'json-schema'
schema = JSON.parse <<JSON
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tag": {
"oneOf": [
@jayniz
jayniz / gist:1869805
Created Feb 20, 2012
could not create data source [nioneodb]
View gist:1869805
org.neo4j.graphdb.TransactionFailureException: Could not create data source [nioneodb], see nested exception for cause of error
at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModule.java:161)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:104)
at org.neo4j.kernel.EmbeddedGraphDbImpl.<init>(EmbeddedGraphDbImpl.java:187)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:80)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:291)
View jogger_1.rb
t = my_pacer_vertex.in(:friends)
t = t.filter(gender: 'female')
t = t.out(:likes)
t = t.filter(type: 'Movie')
t = t.sort_by{ |v, c| -c }
t = t.group_count{ |v| v }
View jogger_3.rb
Jogger.new(my_pacer_node).in(:friends).filter().out(:likes).group_count{}
View jogger_5.rb
class Jogger
module NamedTraversals
# Traverse to somebody's woman friends
def self.friends(current_traversal, gender)
t = current_traversal.in(:friends)
t = t.filter(gender: gender)
end
# Group and sort
View jogger_8.rb
gem "pacer-jogger", :require => "jogger"
View jogger_9.sh
yard server & sleep 3 && open http://localhost:8808/docs/file/README.markdown