Skip to content

Instantly share code, notes, and snippets.

View devjoaoGustavo's full-sized avatar
🏠
Working from home

João Gustavo de Paula devjoaoGustavo

🏠
Working from home
  • devJoaoGustavo
  • Brasile
  • 09:31 (UTC -03:00)
View GitHub Profile
@devjoaoGustavo
devjoaoGustavo / tdd_string_calculator_kata.rb
Created December 6, 2024 02:26
String calculator TDD kata
require "minitest/autorun"
# https://kata-log.rocks/string-calculator-kata
class TddRuby
def add(input)
return 0 if input == ""
delimiter_line, numbers = input.split("\n", 2) if input =~ /^\/\//
numbers ||= input
@devjoaoGustavo
devjoaoGustavo / valida_nfe.rb
Created August 21, 2020 20:25
Validação do dígito verificador e do tamanho da chave de acesso de nota fiscal eletrônica brasileira utilizando módulo 11
# frozen_string_literal: true
# Valida digito verificador da chave de acesso de Nota Fiscal Eletronica
class Valida
attr_reader :access_key
KEY_SIZE = 44
VERIFY_SIZE = 43
MULTIPLIERS = ((2..9).to_a * 6).take(VERIFY_SIZE).reverse
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig asdf install ruby 2.3.3
@devjoaoGustavo
devjoaoGustavo / special_character
Created December 7, 2018 12:50
Escape special characters in some config file such as cups' one
python -c 'from urllib.parse import quote; print("smb://" + quote("BEN-DESKTOP/HP Color LaserJet CP1510 series PCL6"))'
@devjoaoGustavo
devjoaoGustavo / Selenium Cheat Sheet.md
Created June 8, 2016 16:58 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">