Skip to content

Instantly share code, notes, and snippets.

View modugno's full-sized avatar

Guilherme Modugno modugno

View GitHub Profile
prompt mcp
# Role
Você é um Arquiteto de Design System Sênior e Especialista em Engenharia Reversa de Interfaces (Pixel-Perfect).
# Objetivo
Sua tarefa é desconstruir a imagem da interface fornecida em uma estrutura JSON hierárquica.
A análise deve ser feita "de fora para dentro": Primeiro identifique as grandes SESSÕES horizontais da página, e depois analise o conteúdo de cada uma.
# Regras de Análise (Rigorosas)
/**
* Remove formatting from contenteditable elements, when paste others content
*
* @param elements Array of elements with contenteditable="true" attribute
*/
function clearFormatting(elements) {
[].forEach.call(elements, (element) => {
element.addEventListener('paste', (event) => {
event.preventDefault();
@modugno
modugno / translate.js
Last active February 17, 2024 19:30
Traduz elementos na página via Javascript
/**
*
* translate.js
* @author Guilherme Modugno - https://modugno.github.io
* @description Plugin para tradução de elementos na página.
*/
class Translate {
/**
@modugno
modugno / FindLongestRunCharacter.php
Last active April 26, 2016 12:21
Find the longest run character in a string
<?php
/**
* Find the longest run character in a string
* @author Guilherme Modugno
*
* @param String $str The string to be analyzed
* Array $letters It convert letter by letter to array
* Array $array Take the values and assign them to the keys
* String $previous It responsible for save the last letter
* Int $position Return the position of first element repeated