Skip to content

Instantly share code, notes, and snippets.

devver

Block or report user

Report or block devver

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
View ruby_subprocesses_part_2.rb
# :PROCESS: ruby, "ruby %f 2>&1"
# :BRACKET_CODE: "[ruby]", "[/ruby]"
# :TEXT:
#
# In the <a
# href="http://devver.net/blog/2009/06/a-dozen-or-so-ways-to-start-sub-processes-in-ruby-part-1/">previous
# article</a> we looked at some basic methods for starting subprocesses in Ruby.
# One thing all those methods had in common was that they didn't permit a lot of
# communication between parent process and child. In this article we'll examine
# a few built-in Ruby methods which give us the ability to have a two-way
View test_helper.rb
class Test::Unit::TestCase
def capture_io
require 'stringio'
orig_stdout, orig_stderr = $stdout, $stderr
captured_stdout, captured_stderr = StringIO.new, StringIO.new
$stdout, $stderr = captured_stdout, captured_stderr
yield
@devver
devver / env.rb
Created Sep 15, 2009
Using Construct with Cucumber
View env.rb
require 'construct'
World(Construct::Helpers)
Before do
@construct = create_construct
end
After do
@construct.destroy!
View gist:268220
ben@slim:~/code/ruby/gemcutter/gem [master]$ GEMCUTTER_URL=http://staging.rubygems.org gem webhook gemcutter_sample_webhook -a http://ben.devver.net:4567/gemcutter
Adding webhook...
Successfully created webhook for gemcutter_sample_webhook to http://ben.devver.net:4567/gemcutter
ben@slim:~/code/ruby/gemcutter/gem [master]$ GEMCUTTER_URL=http://staging.rubygems.org gem webhook gemcutter_sample_webhook -f http://google.comTest firing webhook...
Successfully deployed webhook for gemcutter_sample_webhook to http://ben.devver.net:4567/gemcutter
View gist:268242
gemcutter_sample_webhook:
- http://ben.devver.net:4567/gemcutter1
15 attempted posts
93.3% success rate
- http://ben.devver.net:4567/gemcutter2
8 attempted posts
50.0% success rate
View gist:268254
puts "abc".gsub(/a(b)c/) {$1+$1} # bb
puts "abc".gsub(/a(b)c/) { $&+$&} # abcabc
@devver
devver / terms_of_service.markdown
Created Apr 26, 2010
A general Terms of Service under the Creative Commons License
View terms_of_service.markdown

Terms of Service

Last revised on [DATE]

The Gist

[COMPANY] operates the [SERVICE] service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.

For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.

View privacy_policy.markdown

Privacy Policy

Last revised on [DATE]

The Gist

[COMPANY] will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

You can’t perform that action at this time.