Skip to content

Instantly share code, notes, and snippets.

@mubbashir
mubbashir / chrome_driver_path
Created March 26, 2014 03:56
setting up chrome-driver path in ruby
require 'selenium-webdriver'
Selenium::WebDriver::Chrome.driver_path="/path/to/chrome_driver_binary/chromedriver"
driver = Selenium::WebDriver.for :chrome
driver.get("http://google.com")
@brandonaaskov
brandonaaskov / jQuery Change Event: Proper Binding
Created January 11, 2012 21:34
jQuery's change() event doesn't work as expected with input text fields. This, however, does work.
/*
For some reason, the change() event only fires when the input field loses focus.
Binding to other options ('change keypress paste focus textInput input') will
fire the event several times, which is bad. The below code works even when
content is pasted into the text field, and only fires once as expected.
*/
$('#search-form .term').bind('input', function(){
console.log('this actually works');
});