Skip to content

Instantly share code, notes, and snippets.

@afn
afn / gist:c04ccfe71d648763b306
Created June 12, 2014 15:35
Restart phantomjs when it hangs
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb
CAPYBARA_TIMEOUT_RETRIES = 3
RSpec.configure do |config|
config.around(:each, type: :feature) do |ex|
example = RSpec.current_example
CAPYBARA_TIMEOUT_RETRIES.times do |i|
example.instance_variable_set('@exception', nil)
self.instance_variable_set('@__memoized', nil) # clear let variables
@colindean
colindean / Gemfile
Last active June 2, 2017 11:33
Simple DNSSD FTPS client/server written as an example of a secure file transfer system of peer-to-peer nature with autodiscovery, ala https://pay.reddit.com/r/ruby/comments/1y13h4/secure_peertopeer_in_ruby/
source 'https://rubygems.org'
gem 'dnssd'
gem 'double-bag-ftps'
gem 'ftpd'
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')