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
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |
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
require 'rubygems' | |
require 'selenium-webdriver' | |
path = File.expand_path("test.html") | |
File.open(path, "w") { |io| io << DATA.read } | |
browser = Selenium::WebDriver.for :firefox # replace :firefox with the browser you're having trouble with | |
begin | |
browser.get "file://#{path}" |
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
require 'selenium-webdriver' | |
# | |
# Read more about LoadableComponent here: | |
# | |
# http://code.google.com/p/selenium/wiki/LoadableComponent | |
# | |
class LoadableComponent | |
attr_reader :driver |
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
def per_page_select(collection, name=nil, value=nil, options={}) | |
unless collection.empty? | |
per_page = collection.first.class.per_page | |
name = name || 'per_page' | |
value = value || params[:per_page] || per_page.to_s | |
before = options[:before_default] || ["#{per_page/2}"] | |
after = options[:after_default] || ["#{per_page*2}"] | |
choices = options_for_select(before + ["#{per_page}"] + after, value) | |
select_tag name, choices, options | |
end |
NewerOlder