Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Henrique Silvério HenriqueSilverio

🏠
Working from home
View GitHub Profile
View interview.md

A entrevista é um processo de mão dupla: entrevistador e candidato podem fazer perguntas.

Tecnologia

  • Quais linguagens / frameworks utilizam na stack atual?
  • Qual arquitetura do projeto? Ex: Monolítico, Microsserviços...
  • Qual o processo para enviar código do repositório para produção? Ex: CI/CD, Containers...
  • Qual o processo para adotar / testar novas tecnologias? Ex: Autonomia da equipe, Equilíbrio de objetivos

Processos

View capitalize.js
const capitalize = (string = '') => {
if (toString.call(string) !== '[object String]') {
return ''
}
const name = string.split(' ')[0]
return name.charAt(0).toUpperCase() + name.slice(1)
}
View app-start-base.js
const cleanup = async () => {
try {
console.log('Cleaning up')
} catch (error) {
console.error(error)
process.exit(1)
}
}
const start = async () => {
View String.toByteArray.js
// Implementation of Kotlin `String.toByteArray` in JavaScript
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-byte-array.html
const UTF8ByteArrayFromString = (string) => {
const encoder = new TextEncoder()
return encoder.encode(string)
}
const stringFromUTF8ByteArray = (array) => {
const decoder = new TextDecoder()
View async-error-handling-2.js
const start = async () => {
try {
throw new Error('Failed to start!')
} catch (err) {
await somethingThrows()
}
}
start()
.catch(err => {
View async-error-handling.js
const start = async () => {
throw new Error('Failed to start!')
}
start()
.catch(async err => {
// Precisa de async no catch pra fazer upload de alguma coisa por exemplo...
// Mas por ser async, pode por sua vez dar erro também...
// Então throw novamente...
throw new Error('Failed to catch start error!')
View settings.json
{
"[csv]": {
"files.encoding": "windows1252"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.formatOnSave": false
View factory.js
const client = { name: 'RabbitMQ' }
const broker = () => ({
client,
connection: null,
async connect (url) {
if (!this.connection) {
this.connection = `Connected to: ${url}`
}
return this.connection
View broker-manager.js
const BrokerManager = function BrokerManager () {
let connection = null
let channel = null
return Object.create({
async getConnection () {
if (!connection) {}
return connection
},
async getChannel () {
if (!channel) {}
View extract-from-playlist.js
(() => {
const tracksSelector = '.tracklist-row'
const $tracks = Array.from(document.querySelectorAll(tracksSelector))
const tracks = $tracks.reduce((result, track) => {
const { name, artist } = {
name: track.querySelector('.tracklist-name').innerText.trim(),
artist: track.querySelector('.tracklist-row__artist-name-link').innerText.trim()
}
return `${result}\n${name} - ${artist}`
}, '')