Skip to content
View rakefile different platforms
require 'rake/clean'
require 'rubygems/package_task'
$:.unshift 'lib'
require 'pry/version'
CLOBBER.include('**/*~', '**/*#*', '**/*.log')
CLEAN.include('**/*#*', '**/*#*.*', '**/*_flymake*.*', '**/*_flymake', '**/*.rbc', '**/.#*.*')
desc "Set up and run tests"
View example_output.txt
2.1.2 :004 > pp
[{:emails=>{:other=>{:address=>"", :primary=>true}},
{:main=>"(555) 123-1234", :home=>"123-123-1234", :mobile=>"555-555-5555"},
{:home=>{:address=>"something", :protocol=>"AIM"},
:other=>{:address=>"something-else", :protocol=>"AIM"}},


There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?


The Ruby Way! (Fun)

View IKEA graphgist
= IKEA GraphGist =
This gist is to complement the[more elaborate blogpost] that I wrote about using[neo4j] to model the partlist and the assembly process of two IKEA wardrobes.
First, we will create a part of the graph using this model:
View network_management.adoc

Network Management with Neo4j

Neo4j is often used to model complex graphs in Network Management scenarios. This is a pseudo setup for a network management graph and some sample queries.

	(ogd:Repeater {name:"Ogden", locid : "ogd", factype: "rcl"}),
	(qtj:Repeater {name:"Brigham City",locid: "qtj",factype: "rcl"}),
	(qli:Repeater {name:"Promotory",locid: "qli",factype: "rcl"}),
View GraphGist-syntax.adoc

How to create a GraphGist

You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page. Alternatively, you can put an AsciiDoc document in Dropbox and enter the public URL in the form.

This GraphGist shows the basics of using AsciiDoc syntax and a few additions for GraphGists. The additions are entered as comments on their own line. They are: //console for a query console; //hide, //setup and //output to configure a query; //graph and //table to visualize queries and show a result table.

Click on the Page Source button in the menu to see the source for this GraphGist.

View gist:5515142
module Functional
def unary
->(a,*b){ a}
def binary
->(a,b,*c){ [a,b]}
View open_to_path
def my_open(filename)
filename = filename.to_path if filename.respond_to?(:to_path)
filename = filename.to_str
# ...
View test.rb
def async_fetch(url)
f = Fiber.current
http = :timeout => 10
http.callback { f.resume(http) }
http.errback { f.resume(http) }
return Fiber.yield
View gist:906649
require 'pathname'
require 'fileutils'
require 'set'
base = Pathname('/newdir/obsolete')
old_dirs =
Pathname.glob('dir/*/obsolete/*').each do |pn|
dir, file = pn.split
customer = dir.parent.basename
Something went wrong with that request. Please try again.