Skip to content

Instantly share code, notes, and snippets.

View paulghaddad's full-sized avatar

Paul Haddad paulghaddad

View GitHub Profile
@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')
@paulghaddad
paulghaddad / hamming.rb
Last active August 29, 2015 14:10
Exercism: Hamming
####### Submission for Hamming Exercism Problem #########
class Hamming
def self.compute(strand, comparison_strand)
return 0 if strand == comparison_strand
strand_array = strand.split(//)
comparison_strand_array = comparison_strand.split(//)
compute_difference(strand_array, comparison_strand_array)
end
def self.compute_difference(strand_1, strand_2)