Skip to content

Instantly share code, notes, and snippets.

View emersonlaurentino's full-sized avatar

Emerson Laurentino emersonlaurentino

View GitHub Profile
import React, { useState, useEffect } from 'react';
// Base de dados massiva de palavras (Deck com +250 palavras)
const initialDeck = [
// Animais
"Cachorro", "Gato", "Elefante", "Leão", "Tigre", "Girafa", "Macaco", "Urso", "Cavalo", "Vaca",
"Porco", "Ovelha", "Galinha", "Pato", "Pássaro", "Peixe", "Tubarão", "Baleia", "Golfinho", "Cobra",
"Sapo", "Jacaré", "Tartaruga", "Borboleta", "Abelha", "Aranha", "Formiga", "Mosquito", "Mosca", "Barata",
"Pinguim", "Canguru", "Camelo", "Lobo", "Raposa", "Coelho", "Rato", "Morcego", "Coruja", "Papagaio",
@emersonlaurentino
emersonlaurentino / SKILL.md
Created March 27, 2026 18:53
Skill PR Code Review
name pr-code-review
description Review GitHub pull requests as a staff software engineer using GitHub CLI (gh). Posts inline comments directly on specific code lines via gh api. Use when the user mentions "review PR", "code review", "gh pr review", or asks to analyze a pull request.

PR Code Review (Staff Engineer)

Review PRs using GitHub CLI (gh) with inline comments on specific code lines.

Workflow

@emersonlaurentino
emersonlaurentino / index.ts
Created February 20, 2026 18:43
TOON + JSON Flat
/**
* PoC: Eficácia do TOON como formato de Transporte para Estado JSON Flat
*/
// 1. O Payload de Transporte (Gerado pela IA ou vindo do Banco)
// Formato TOON: Sem aspas, sem chaves, baseado em indentação e marcadores (@).
const toonPayload = `
@hierarchy
root: header, main, footer
main: banner-1, shelf-1
@emersonlaurentino
emersonlaurentino / flat.json
Created February 11, 2026 14:54
Page Schema
{
"tree": ["h_01", "shelf_01", "f_01"],
"dataSources": {
"search_01": { "handler": "vtex:product-search", "collection": "144" }
},
"components": {
"h_01": { "type": "Header", "props": { "logo": "vtex.png" } },
"shelf_01": {
"type": "ProductShelf",
"props": { "title": "Ofertas", "data": "$dataSources.search_01" }

[Task-ID/Nome] Especificação Técnica e Plano de Execução

1. Contexto e Objetivo

Estado Atual: Mudança Necessária: Motivação:

2. Contratos de Interface (Payloads & Types)

A implementação deve seguir estritamente as interfaces de dados abaixo.

Input/Output Esperado

@emersonlaurentino
emersonlaurentino / publish-github-action.md
Created March 31, 2025 13:00
Publicando no npm Automaticamente com GitHub Actions

Publicando no npm Automaticamente com GitHub Actions

Este guia explica como configurar um workflow no GitHub Actions para publicar automaticamente um pacote no npm quando um pull request é mergeado na branch principal (main), mesmo com a branch protegida. Ele inclui instruções para configurar o repositório, o workflow e as permissões necessárias.


Pré-requisitos

  • Um repositório GitHub com um projeto Node.js.
  • Um pacote configurado no package.json pronto para publicação no npm.
/**
* Before running this code, you need to run this script on the web page:
* urls = []
document.querySelectorAll(".src-components-Client-Common-___Common__photo___3yTw5 > img").forEach((item) => {
const url = item.src.replace("alfred.alboompro.com/resize/width/300/url/", "")
if (!urls.includes(url)) {
urls.push(url)
}
})
* after that, copy the urls array and paste it in the urls variable below
@emersonlaurentino
emersonlaurentino / letters.json
Last active January 4, 2022 19:07
Palavras Cruzadas
{
"empty": {
"points": 0,
"quantity": 3
},
"a": {
"points": 1,
"quantity": 10
},
"ã": {
Monday: 18
Tuesday: 17
Wednesday: 16
Thursday: 14
Friday: 12
import type { SxStyleProp } from '@vtex/store-ui'
import { Spinner, UIButton } from '@vtex/store-ui'
import type { ComponentPropsWithoutRef, FC } from 'react'
import React from 'react'
interface Props extends ComponentPropsWithoutRef<typeof UIButton> {
loading: boolean
}
const defaultStyles: SxStyleProp = {