Skip to content

Instantly share code, notes, and snippets.

Brian Underwood cheerfulstoic

Block or report user

Report or block cheerfulstoic

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
@cheerfulstoic
cheerfulstoic / output
Created Oct 15, 2019
string_concat_test.rb
View output
Warming up --------------------------------------
interpolation 151.958k i/100ms
StringIO << 57.897k i/100ms
StringIO concat 103.750k i/100ms
Calculating -------------------------------------
interpolation 2.482M (± 9.9%) i/s - 9.877M in 4.027092s
StringIO << 45.806B (±33.8%) i/s - 119.834B
StringIO concat 100.679B (±15.4%) i/s - 272.862B
Comparison:
View risk_battle.rb
def die_roll
rand(6) + 1
end
def attack(attacking_count, defending_count)
attacking_dice = [attacking_count, 3].min
defending_dice = [defending_count, 2].min
attacking_rolls = attacking_dice.times.map { die_roll }.sort.reverse
defending_rolls = defending_dice.times.map { die_roll }.sort.reverse
@cheerfulstoic
cheerfulstoic / gist:7d64cc4a3d87162c09562ffe283d813c
Created Jan 31, 2018
Queries and R code for Paradise Papers presentation
View gist:7d64cc4a3d87162c09562ffe283d813c
# R setup
library(RNeo4j)
graph = startGraph("http://localhost:7474/db/data/")
# Queries:
# What types of objects are we dealing with?
MATCH (n)
View .tmux.conf
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind-key -n S-Up resize-pane -U 5
bind-key -n S-Down resize-pane -D 5
bind-key -n S-Left resize-pane -L 5
bind-key -n S-Right resize-pane -R 5
@cheerfulstoic
cheerfulstoic / neo4jrb.yml
Last active Sep 22, 2017
tmuxinator file for working on Neo4j.rb projects
View neo4jrb.yml
# ~/.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 Nov 20, 2019
Repository Maintenance Levels
View Repository Maintenance Levels.md

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

View gist:7ace53e80a6d9efc75b30b376b97da1a
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
View neo4jrb 8.0 upgrade notes.md
  • server_db mode has been removed and should be replaced by either http or bolt
View Welcome message for neo4j.rb gitter.md

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.

View acid_test.adoc

GraphGist acid test

GraphGist created to test the various features available to GraphGist rendering

5giAsjq
You can’t perform that action at this time.