save_and_open_page
have_button(locator)In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
| # Simple web service that looks for an image metadata record on a MySQL db given its ID and sends it back in JSON | |
| # | |
| # Ruby 1.9.3 | |
| # All gems updated to the most recent version | |
| # MBP i5 8gb Lion | |
| # | |
| # See source code above, combo is: | |
| # Sinatra + Thin: | |
| # - mysql_db.rb # mysql2 api class | |
| # - sinatra_thin_server.rb |
| #!/usr/bin/perl | |
| use Mysql; | |
| use strict; | |
| use vars qw($school_name); | |
| use vars qw($pass); | |
| require "./cgi-lib.pl"; |
| ENV["WATCHR"] = "1" | |
| system 'clear' | |
| def growl(message) | |
| growlnotify = `which growlnotify`.chomp | |
| title = "Watchr Test Results" | |
| puts message | |
| image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png" | |
| options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
| system %(#{growlnotify} #{options} &) |
| # Typically in Rails to use VCR we setup the RSpec config like so: | |
| RSpec.configure do |config| | |
| config.extend VCR::RSpec::Macros #deprecated | |
| end | |
| # This gives us access to the use_vcr_cassette method: | |
| describe Reviewed::Article do | |
| use_vcr_cassette 'article/grill' | |
| end | |
| module Saucelabs | |
| SAUCE_USERNAME = '' | |
| SAUCE_TOKEN = '' | |
| def self.setup_saucelabs_connection!(driver=nil) | |
| WebMock.allow_net_connect! | |
| driver ||= { | |
| capability: :chrome, | |
| platform: 'Windows 8', | |
| version: '', |
| namespace :routes do | |
| desc "Writes doc/routes.html. Requires Graphviz (dot)" | |
| task :visualizer => :environment do | |
| File.open(Rails.root.join('doc', 'routes.html'), 'wb') do |f| | |
| f.write Rails.application.routes.router.visualizer | |
| end | |
| end | |
| end |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000