Skip to content

Instantly share code, notes, and snippets.

View RobertoBarros's full-sized avatar

Roberto Barros RobertoBarros

View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
Criteria ID,Name,Canonical Name,Parent ID,Country Code,Target Type,Status
"1000002","Kabul","Kabul,Kabul,Afghanistan","9075393","AF","City",Active
"1000003","Luanda","Luanda,Luanda Province,Angola","9070431","AO","City",Active
"1000004","The Valley","The Valley,Anguilla","2660","AI","City",Active
"1000007","Kralendijk","Kralendijk,Bonaire,Caribbean Netherlands","9075436","BQ","City",Active
"1000008","Philipsburg","Philipsburg,Sint Maarten","2534","SX","City",Active
"1000009","Willemstad","Willemstad,Curacao","2531","CW","City",Active
"1000010","Abu Dhabi","Abu Dhabi,Abu Dhabi,United Arab Emirates","9041082","AE","City",Active
"1000011","Ajman","Ajman,Ajman,United Arab Emirates","9047096","AE","City",Active
"1000012","Al Ain","Al Ain,Abu Dhabi,United Arab Emirates","9041082","AE","City",Active
@RobertoBarros
RobertoBarros / interface.rb
Created April 30, 2024 18:00
batch_1680_reboot_giftslist_final
require 'colored'
require 'csv'
require 'open-uri'
require 'nokogiri'
FILEPATH = 'gifts.csv'
# Os gifts estão em um array de hash como:
# [
# { name: 'Meia', bought: true, price: 200 },
@RobertoBarros
RobertoBarros / interface.rb
Created April 30, 2024 17:06
batch_1680_reboot_giftslist_part2
require 'colored'
require 'csv'
FILEPATH = 'gifts.csv'
# Os gifts estão em um array de hash como:
# [
# { name: 'Meia', bought: true },
# { name: 'iPhone', bought: false }
#]
@RobertoBarros
RobertoBarros / interface.rb
Created April 30, 2024 15:00
batch_1680_reboot_giftslist_part1
require 'colored'
require 'csv'
FILEPATH = 'gifts.csv'
def list(gifts)
gifts.each_with_index do |gift, index|
puts "#{index + 1} - #{gift}"
end
end
@RobertoBarros
RobertoBarros / instacart.rb
Created April 29, 2024 18:39
batch_1680_reboot_instacart_final
# Mensagem de boas vindas
puts '-' * 30
puts "Bem Vindos ao Mercado Tabajara"
puts '-' * 30
products = {
"kiwi" => { stock: 5, price: 1.25 },
"banana" => { stock: 10, price: 0.50 },
"mango" => { stock: 3, price: 4 },
"apple" => { stock: 25, price: 3 }
@RobertoBarros
RobertoBarros / instacart.rb
Created April 29, 2024 17:48
batch_1680_livecode_instacart_part2
# Mensagem de boas vindas
puts "-" * 30
puts "Bem Vindos ao Mercado Tabajara"
puts "-" * 30
products= {
"kiwi" => 1.25,
"banana" => 0.50,
"mango" => 4,
"apple" => 3
}
@RobertoBarros
RobertoBarros / instacart.rb
Created April 29, 2024 17:17
batch_1680_reboot_instacart_part1
# Mensagem de boas vindas
puts "-" * 30
puts "Bem Vindos ao Mercado Tabajara"
puts "-" * 30
products= {
"kiwi" => 1.25,
"banana" => 0.50,
"mango" => 4,
"apple" => 3
}
@RobertoBarros
RobertoBarros / interface.rb
Created April 29, 2024 15:15
batch_1680_reboot_horse_race
account = 100
# 1. Boas vindas à corrida
puts "Bem vindo a corrida de cavalos Tabajara!"
horses = %w[preto malhado branco pe-de-pano pegasus]
loop do
puts "Seu saldo é de #{account}"
@RobertoBarros
RobertoBarros / calculator.rb
Created April 29, 2024 14:27
batch_1680_reboot_calculator
def calculator(number1, number2, operator)
case operator
when "+" then number1 + number2
when "-" then number1 - number2
when "/" then number2 == 0 ? "Inválido" : number1 / number2
when "*" then number1 * number2
else
"Inválido"
end
end
const content = document.getElementById('content')
// const content = document.querySelector('#content')
const beatles = ["paul", "john", "ringo", "george"];
let items = ''
beatles.forEach((beatle) => {
items += `<li>${beatle}</li>`
})
// console.log(items);