Skip to content

Instantly share code, notes, and snippets.

@myronmarston
myronmarston / some_spec.rb
Created April 16, 2012 15:00 — forked from tommeier/some_spec.rb
VCR with placeholders
use_vcr_cassette 'some/cassette', :tag => :bad_staging_api
@myronmarston
myronmarston / triangle.rb
Created June 29, 2012 17:59 — forked from brenfrow/triangle.rb
triangle
TriangleError = Class.new(ArgumentError)
Triangle = Struct.new(:x, :y, :z) do
def initialize(*args)
super
validate
end
def type
TYPES.fetch(uniq_side_lengths)
@myronmarston
myronmarston / test_it.rb
Created August 7, 2012 02:18 — forked from jrochkind/test_it.rb
VCR, WebMock, HTTPClient weirdness
require 'httpclient'
require 'vcr'
require 'webmock'
require 'test/unit'
# To allow us to do real HTTP requests in a VCR.turned_off, we
# have to tell webmock to let us.
WebMock.allow_net_connect!
VCR.configure do |c|
# A sample Gemfile
source "http://rubygems.org"
gem 'vcr'
gem 'fakefs'
gem 'typhoeus'
gem 'fakeweb'
gem 'rspec'
gem 'rr'
@myronmarston
myronmarston / queues.rb
Last active January 4, 2016 01:39 — forked from dlecocq/queues.rb
➜ 8549841 git:(master) ✗ ruby queues.rb
Popping before put
popped job:
popped job:
popped job:
popped job:
popped job:
popped job:
popped job:
popped job:
@myronmarston
myronmarston / observer.md
Created November 5, 2015 23:26 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host