Skip to content

Instantly share code, notes, and snippets.

View JEG2's full-sized avatar

James Edward Gray II JEG2

View GitHub Profile
@JEG2
JEG2 / db.rb
Created September 15, 2012 17:47
Simple database usage.
require "yaml/store"
db = YAML::Store.new("db.yml")
email = "james@graysoftinc.com"
db.transaction do
db[email] = [ ]
end
db.transaction do
module Extensions
module_function
def separate(path)
extensions = path.reverse
.scan(/\G\w+\./)
.map { |e| e[0..-2].reverse }
.reverse
file_name = path.split(".")[0..-(extensions.size + 1)].join(".")
[file_name, extensions]
@JEG2
JEG2 / ruby_nuby_videos.md
Created November 1, 2012 13:57
All of the videos created for the Ruby Nuby Project of the Ruby Rogues podcast.
@JEG2
JEG2 / vcr_spec.rb
Created November 12, 2012 18:45
The problem I'm having getting Typhoeus and VCR to cooperate.
require "typhoeus"
require "vcr"
VCR.configure do |config|
config.cassette_library_dir = "vcr_cassettes"
config.hook_into :typhoeus
end
describe VCR do
it "should work with a queue" do
@JEG2
JEG2 / Gemfile.lock
Created November 12, 2012 19:41
Typhoeus and VCR version numbers.
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.3)
ethon (0.5.2)
ffi (~> 1.0.11)
mime-types (~> 1.18)
ffi (1.0.11)
mime-types (1.19)
rake (0.9.2.2)
@JEG2
JEG2 / Gemfile
Created November 13, 2012 15:22
Another Typhoeus VCR failure
gem "typhoeus", git: "https://github.com/typhoeus/typhoeus.git",
ref: "8e815cdf4fed2322947e2338d6f5b084c820a70b"
gem "vcr"
gem "rspec"
@JEG2
JEG2 / Gemfile
Created November 20, 2012 21:46
Another Typhoeus VCR Interaction Bug
source :rubygems
gem "typhoeus", "~> 0.5.2"
gem "vcr", "~> 2.3.0"
gem "rspec"
class MethodCounter
def initialize
@signature = ENV.fetch("COUNT_CALLS_TO")
@path = @signature.split(/(?:::|#)/)
@scope = @signature.include?("#") ? :instance : :class_or_module
@count = 0
@wrapping = false
@wrapped = false
end
@JEG2
JEG2 / agenda.md
Last active December 13, 2015 20:28
The agenda for the AOK's February 2013 board meeting.

AOK Board Meeting

Fedruary 17th, 2013 at 2:00 PM

Midwest City Library
8143 East Reno Ave.
Midwest City, OK73110

Open to all: AOK board meetings are open to any members that wish to attend.

app@botqueen1:/u/apps/botqueen/current$ bundle exec ruby foo.rb
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************
Ran 100 requests ******************************