Skip to content
View Docker
## Docker
Docker is a platform to build, ship and run distributed applications. The platform is made up of two components:
1. Docker server
This runs as a daemon and manages all the containers.
2. Docker client
View gist:0d8d3ee93fd79aefcfd8

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at:

2. Install the Command Line Tools (CLT)

View cookie.js
View load-js-dynamically
function loadScript(url, callback){
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" ||
View MySingleton.js
var instance = null;
function MySingleton(){
if(instance !== null){
throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()");
View standalone.rb
#!/usr/bin/env ruby
puts "Run this in another terminal:"
puts ""
puts " sudo ./ #{$$}"
puts ""
puts "... wait for the 'Ready!' message, switch back here and press enter to start."
View lib-rails_compatible_simple_delegator.rb
# See:
# *
# *!topic/rubyonrails-core/PjGUK72BmFA
# *
require "delegate"
class RailsCompatibleSimpleDelegator < SimpleDelegator
def self.const_missing(name)
if ::Object.const_defined?(name)
View stub v should_receive
## stub v should_receive
## This is just a simple example to show uses of stub, and should_receive. Imagine you have the following code:
# topic.rb
class Topic < ActiveRecord::Base
has_many :stories
def add_story(story)
unless exists? story

This is a proof-of-concept of a couple of concurrent data structures written in Ruby.

The implementations are heavily commented for those interested. There are benchmarks (with results) included below. The results are interesting, but, as always, take with a grain of salt.

Data structures

AtomicLinkedQueue is a lock-free queue, built on atomic CAS operations.

View tracepoint.rb
class Foo
def; end
def foo; end
tp ="call") do |trace|
p [trace.defined_class, trace.method_id, trace.event, trace.lineno]
Something went wrong with that request. Please try again.