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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
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 'lastpass' | |
cloudbleed_sites_uri = URI('https://raw.githubusercontent.com/pirate/sites-using-cloudflare/master/sorted_unique_cf.txt') | |
cloudbleed_sites = Net::HTTP.get(sites_uri).split("\n") | |
vault = LastPass::Vault.open_remote 'email', '*********' | |
lastpass_sites = vault.accounts.map { |account| URI(account.url).host }.uniq.sort | |
affected_sites = lastpass_sites.select { |lastpass_site| cloudbleed_sites.include?(lastpass_site) } |
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
SQUARE_FEET_PER_ACRE = 43560 | |
def circumference_in_feet_for_number_of_acres(number_of_acres) | |
area = number_of_acres * SQUARE_FEET_PER_ACRE | |
radius = radius_of_area(area) | |
circumference_of_radius(radius) | |
end | |
# Math::PI * (r ** 2) == area | |
# r ** 2 == area / Math::PI |