Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cheerfulstoic's full-sized avatar

Brian Underwood cheerfulstoic

View GitHub Profile
@cheerfulstoic
cheerfulstoic / neo4jrb.yml
Last active September 22, 2017 16:54
tmuxinator file for working on Neo4j.rb projects
# ~/.tmuxinator/neo4jrb.yml
name: neo4jrb
root: ~/github/neo4jrb
# Optional tmux socket
# socket_name: foo
# Runs before everything. Use it to start daemons etc.
pre:
@cheerfulstoic
cheerfulstoic / Repository Maintenance Levels.md
Last active February 21, 2024 02:46
Repository Maintenance Levels

After reading Why I'm Frequently Absent from Open Source by James Long and listening the corresponding The Changelog episode, I dwelt on the idea and believe that open source maintainers...

  • ... should never be ashamed if they don't have time for a project.
  • ... should be honest with themselves and open with their users so that everybody can be on the same page
  • ... are people and they have at one time or another responsibilities or hardships that they need to attend to which reasonably take them away from a project
  • ... may also reasonbly decide that they don't like the direction of a project or that they would like to explore other things and may leave a project permanently.

Along this line of thinking I've created a set of descriptions for different levels at which a project might be maintained. A maintainer can use these to announce to their users the current ability that they have to dedicate to a pr

@cheerfulstoic
cheerfulstoic / gist:7ace53e80a6d9efc75b30b376b97da1a
Created December 23, 2016 13:53
Rails generator wizard idea
rails g migration
What would you like to call your migration? > Something
Which of the following would you like to do:
1 - create a table
2 - add a column
3 - remove a column
# etc…
> 1
What would you like to call your table? somethings
Please give the first column for your table: name
@cheerfulstoic
cheerfulstoic / neo4jrb 8.0 upgrade notes.md
Created July 4, 2016 12:21
Neo4j.rb 8.0 upgrade notes
  • server_db mode has been removed and should be replaced by either http or bolt

Welcome to the Gitter channel for the Neo4j.rb project (the neo4j, neo4j-core, and neo4j-rake_tasks gems)

  • Our official documentation is on http://neo4jrb.readthedocs.org
  • If you have a question, ask away! If we aren't around this is the best way that we can get you an answer quickly.
  • If you’ve found a bug, please provide steps to reproduce it and the versions of the gems you are using.
  • Keep in mind that all contributors to the Neo4j.rb project are working on it in their free time. We are not part of Neo Technology (the makers of Neo4j)

Background:

The neo4j / neo4j-core gems were originally created by @andreasronge as a way to connect to Neo4j in embedded mode via jRuby. Since version 3.0 of the gem (Sept 2014), it is possible (and probably most common) to connect via Neo4j's HTTP endpoints in server mode. Support for Neo4j's binary protocol ("Bolt") is planned for version 8.0 of neo4j and 7.0 of neo4j-core.

@cheerfulstoic
cheerfulstoic / acid_test.adoc
Last active April 8, 2016 06:46
Test GraphGist

GraphGist acid test

GraphGist created to test the various features available to GraphGist rendering

5giAsjq
@cheerfulstoic
cheerfulstoic / relationships_demo.md
Created March 4, 2016 06:44
Relationships in Neo4j.rb

You can, of course, just execute a Cypher query:

session = Neo4j::Session.open(:server_db, 'http://neo4j:password@localhost:7474')

result = session.query("MATCH (p:Person {uuid: {uuid}})-[r:LIKES]->(f:Food) RETURN p, r, f", uuid: 1234)

# First result
result[0].p # Person
result[0].r # `LIKES` Relationship
app:
build: .
command: bundle exec rails server -b 0.0.0.0
ports:
- "3000:3000"
# volumes:
# - .:/code
links:
- neo4j
environment:
@cheerfulstoic
cheerfulstoic / puts_first_common_point.rb
Created January 30, 2016 15:03
Method to find the first uncommon point in the call stack of a line of Ruby
def puts_first_common_point
if $previous_caller
this_caller = caller[1..-1]
this_caller.each_with_index do |line, i|
if $previous_caller[i] == line
puts line
else
puts 'FIRST DIFFERENT LINE:'
puts "Previous: #{$previous_caller[i]}"
puts "This: #{line}"
@cheerfulstoic
cheerfulstoic / quantizator.rb
Created January 27, 2016 13:51
pngquant script
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'png_quantizator'
require 'tempfile'
speed = ENV['SPEED'] || 1
ARGV.each do |png_path|
puts "Processing #{png_path}..."
file = PngQuantizator::Image.new(png_path)