-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
| @mixin sprite-background($name, $folder) { | |
| $sprites: sprite-map("#{$folder}/*.png"); | |
| $sprites-retina: sprite-map("#{$folder}@2x/*.png"); | |
| background-image: sprite-url($sprites); | |
| background-position: sprite-position($sprites, $name); | |
| background-repeat: no-repeat; | |
| @include inline-block; | |
| height: image-height(sprite-file($sprites, $name)); | |
| width: image-width(sprite-file($sprites, $name)); |
| ## Get FFMpeg working on heroku by building binaries using vulcan | |
| # also added instructions on how to compile with libmp3lame and libx264 | |
| #################################### | |
| # INSTALL VULCAN if not done already | |
| gem install vulcan | |
| ################# | |
| # CREATE YOUR APP "Foo" |
| =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') |
| =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') |
| # config/locales/en.yml | |
| en: | |
| exception: | |
| show: | |
| not_found: | |
| title: "Not Found" | |
| description: "The page you were looking for does not exists." | |
| internal_server_error: | |
| title: "Internal Server Error" |
I wrote a really simple JavaScript script that uses jQuery to extract all the categories from Facebook's "Create a page" page.
| # geo.rb | |
| # Formulas from | |
| # | |
| # haversine formula to compute the great circle distance between two points given their latitude and longitudes | |
| # | |
| # Copyright (C) 2008, 360VL, Inc | |
| # Copyright (C) 2008, Landon Cox | |
| # | |
| # http://www.esawdust.com (Landon Cox) |
| # adapted from bin/sidekiq | |
| # to invoke, run: zeus runner sidekiq.rb | |
| require 'sidekiq/cli' | |
| begin | |
| cli = Sidekiq::CLI.instance | |
| cli.parse | |
| cli.run | |
| rescue => e |
| require 'zeus/rails' | |
| class CustomPlan < Zeus::Rails | |
| def sidekiq | |
| # Based on bin/sidekiq | |
| require 'sidekiq/cli' | |
| begin | |
| cli = Sidekiq::CLI.instance | |
| cli.parse |