Skip to content

Instantly share code, notes, and snippets.

View ribaptista's full-sized avatar

Ricardo Baptista ribaptista

  • São Paulo, Brazil
View GitHub Profile
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
# some metadata about the template itself
metadata:
name: v1beta3-demo
title: Test Action template
description: scaffolder v1beta3 template demo
spec:
owner: backstage/techdocs-core
type: service
@ribaptista
ribaptista / botium.json
Last active January 4, 2024 04:37
botium setup for commerce-ai
{
"botium": {
"Capabilities": {
"PROJECTNAME": "Nightly Tests",
"CONTAINERMODE": "webdriverio",
"__CLEANUPTEMPDIR": true,
"WEBDRIVERIO_SCREENSHOTS": "always",
"__WEBDRIVERIO_OUTPUT_ELEMENT_DEBUG_HTML": true,
"__WEBDRIVERIO_START_CHROMEDRIVER_OPTIONS": [
"--no-sandbox",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>HTML 5 Boilerplate</title>
</head>
<body>
<input type="text" id="message" />

Most frequent word

Given a string named “paragraph” and a list of strings named “forbidden words”, the most frequent word within the paragraph that is not in the forbidden words list should be returned. Only one word should return and this word can’t be a forbidden word. The words within the paragraph are not case sensitive and the answer must be in lower case.

Example # 1:

Input: paragraph = “Bob hit a ball, the hit BALL flew long after it was hit.“, forbiddenWords = [“hit”] Output: “ball”

Explanation:

{"data":{"getEstimate":{"id":60690921,"total":80429.22,"car":{"year":"2020","make":"Volkswagen","model":"Virtus","vin":"9BWDH5BZ8LP100268","color":"BRANCA","mileage":"38560","plateNumber":"FRM6H36"},"customer":{"name":"Joanes Alves dos Santos","email":"[email protected]","city":"Barueri","identity":"14021832831","street":"Rua:R: Sebastião Davino dos Reis","streetNumber":"999","complement":"BL B apto 106","district":"Jd Tupanci","postalCode":"06414-007"}}}}

Javascript Challenge

Instructions

In this challenge we will assess your coding skills. Create a little project implementing a solution for the problem shown below. After you're done, please push your code to a public GitHub repository.

Number Translation Problem

You have arrived in a long forgotten island, called kwego. After 3 days on this island, you realized that their numeric system is the same as the roman system but with different names and came up with the following kwegonian to roman translation table:

ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-
ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-
SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-
GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-
AES128-SHAECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-

TODO LIST

Desenvolva o código em React Native para as seguintes funcionalidades de uma aplicação de TODO LIST:

  • Adicionar um novo item ao TODO
  • Remover um item do TODO
  • Marcar o item como TODO

Não há necessidade de haver persistência, ou seja, não há problemas se, ao recarregar a página, os itens sejam perdidos. Se houver tempo disponível, você pode considerar simular a chamada de uma API REST para persistência da lista.

const toPairs = roman => roman.map((v, i, array) => array.slice(i, i + 2))
const toValues = pairs => pairs.map(([p, n = 0]) => ([romanChars[p], romanChars[n]]))
const toParts = pairs => pairs.map(([p, n = 0]) => p >= n ? p : -p)
const toSum = parts => parts.reduce((part, sum) => sum + part, 0)
const romanChars = {
I: 1,
V: 5,
X: 10,
L: 50,