This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3-p392 :001 > class Test | |
1.9.3-p392 :002?> def self.wtf | |
1.9.3-p392 :003?> "WHAT DA FUCK" | |
1.9.3-p392 :004?> end | |
1.9.3-p392 :005?> | |
1.9.3-p392 :006 > self.singleton_class.send(:alias_method, :wtf_mate, :wtf) | |
1.9.3-p392 :007?> end | |
=> #<Class:Test> | |
1.9.3-p392 :008 > Test.wtf | |
=> "WHAT DA FUCK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-XXXXX-Y']); | |
_gaq.push(['_trackPageview']); | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you were curious how to do it with lambdas, | |
# I think this way makes the method definition look ugly but w/e | |
def method(arr, fn = ->(e){ "" }) | |
arr[:no_key] | |
rescue => e | |
fn.call(e) | |
end | |
method([]) | |
# => "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!define loag {http://local.apartmentguide.com/apartments/Georgia/Norcross/search/} | |
#!| script| | |
!|scenario |User opens advanced search for Norcross GA and checks refinements using|selector|and views the |displayed_name|in the refinements list| | |
|windowMaximize | | |
|user opens |${loag} | | |
|user clicks|css=@selector | | |
|user waits |3000 | | |
|user |verifies |that |css=p.refinement_list|shows text |@displayed_name |
NewerOlder