driver.rotate :landscape
driver.rotate :portrait
find_element(id:'title').text = retorna o texto do elemento
find_element(id:'title').name = retorna o texto do elemento
module Helpers | |
def generate_cep | |
cep = rand(01000000...99990000) | |
generate_cep if cep.size < 8 | |
cep | |
end | |
def generate_password | |
(0...8).map { ([65, 97].sample + rand(26)).chr }.push(rand(99)).join |
while(list of unvisited URLs is not empty) { | |
take URL from list | |
fetch content | |
record whatever it is you want to about the content | |
if content is HTML { | |
parse out URLs from links | |
foreach URL { | |
if it matches your rules | |
and it's not already in either the visited or unvisited list | |
add it to the unvisited list |
def expirate_code | |
sms_code = [] | |
page = Nokogiri::HTML(open(CHANNEL_MANAGER, | |
http_basic_authentication: | |
[CREDENTIALS[:channel_manager][:login], | |
CREDENTIALS[:channel_manager][:password]])) | |
page.search('pre').each do |sms| | |
sms_code << sms.to_s.tr('<pre>', '') |
brew install pkg-config | |
brew uninstall imagemagick | |
brew install imagemagick@6 | |
brew link imagemagick@6 --force |
require 'oily_png' | |
require 'open-uri' | |
include ChunkyPNG::Color | |
def starts_with(item, prefix) | |
prefix = prefix.to_s | |
item[0, prefix.length] == prefix | |
end | |
# compares two images on disk, returns the % difference |
#!/bin/bash | |
# change the folder to /tools | |
cd $(dirname $(which emulator)) && ./emulator -avd Droid22 > /dev/null & | |
cd |
lint.rb:1:1: W: Script file lint.rb doesn't have execute permission. | |
#!/usr/bin/env ruby | |
^^^^^^^^^^^^^^^^^^^ | |
lint.rb:2:1: C: Missing top-level class documentation comment. | |
class Lint | |
^^^^^ | |
lint.rb:3:1: C: Use 2 (not 0) spaces for indentation. | |
def get_even_numbers | |
lint.rb:3:5: C: Do not prefix reader method names with get_. |
15:19 $ rubocop lint.rb -f offenses -f clang | |
-- | |
0 Total |