Skip to content

Instantly share code, notes, and snippets.

View teles's full-sized avatar
👨‍🚀
"A inteligência é o mais pobre dos atributos humanos" - Tom Jobim

Teles teles

👨‍🚀
"A inteligência é o mais pobre dos atributos humanos" - Tom Jobim
View GitHub Profile
@teles
teles / pokemen.md
Last active November 6, 2025 21:27

Pokemen: The Language Revolution

Game Overview and Battle System


Setting

Time: Year 2225 — fifty years after the Pokémon Revolution.
Place: The New United Kingdom, now ruled by Pokémon.
Humans, renamed Pokemen, live inside Cognitive Pokéballs — virtual environments where they spend their lives thinking, debating, and generating Cognitive Energy used to train Pokémon AIs.

SEO para IA (2025) — Guia prático e opinado

“SEO de IA é como ensinar um mapa a conversar: o mapa é o @graph, a bússola é o /.well-known/, e o mar é o seu conteúdo visível.”

Este guia reúne tudo que alinhamos, com foco em implementação usando Ocean Drop como exemplo.


1) Fundamentos em 3 ideias (sem rodeios)

Awesome Click and Use

Download bookmarks file

Useful and awesome online tools that I often use. No download, no signup required. All of these tools are perfect for developers looking for click and use solutions—simply access them online and start working right away.

Artificial Intelligence

  • ChatGPT - Dialogue optimized model
  • GitIngest - AI-powered tool to query and analyze your Git repositories for insights and understanding.

Erro PostgreSQL: cached plan must not change result type (SQLSTATE 0A000)

Esse erro vem do PostgreSQL e significa o seguinte:

“cached plan must not change result type (SQLSTATE 0A000)”

Contexto

  • O PostgreSQL cria planos de execução em cache para consultas parametrizadas (principalmente em prepared statements ou queries vindas de drivers de ORM).
  • Esses planos em cache assumem que a consulta sempre retornará o mesmo conjunto de colunas e tipos.
  • Se, por algum motivo, a mesma query (ou o mesmo statement preparado) puder retornar tipos diferentes em execuções diferentes, o Postgres acusa erro.
/*! For license information please see appmax.min.js.LICENSE.txt */
(()=>{"use strict";const e=class{constructor(e,t,n,a,r){this.number=e,this.holderName=t,this.expirationMonth=n,this.expirationYear=a,this.cvv=r}toJSON(){return{payment_data:{credit_card:{number:this.number,holder_name:this.holderName,expiration_month:this.expirationMonth,expiration_year:this.expirationYear,cvv:this.cvv}}}}},t=class{constructor(e){this.apiClient=e}async tokenizeCard(t,n){const a=new e(t.number,t.holderName,t.expirationMonth,t.expirationYear,t.cvv).toJSON(),r=await this.apiClient.post(`${"MISSING_ENV_VAR".API_APPMAX_URL}/v1/payments/tokenize`,{headers:{"Content-Type":"application/json","external-id":n},body:JSON.stringify(a)});if(r.ok){const{data:e}=await r.json();return e.token}throw new Error("Failed to tokenize card.")}},n=class{async get(e){return await fetch(e)}async post(e,t){return await fetch(e,{method:"POST",...t})}},a=class{constructor(e){this.apiClient=e}async getIP(){const e=await this.apiClient.get(`${"MISSING_ENV_

Apple Pay com Appmax JS

Este guia fornece instruções detalhadas para a integração do Apple Pay utilizando o Appmax JS.

Sobre o Apple Pay

O Apple Pay é uma solução de pagamento digital da Apple que permite aos usuários realizarem compras com cartão de crédito de forma rápida, segura e conveniente por meio de dispositivos compatíveis, como iPhone, iPad, Apple Watch e Mac.

Utilizando tecnologia de tokenização e autenticação biométrica (Face ID ou Touch ID), o Apple Pay elimina a necessidade de inserir manualmente dados do cartão em cada transação, reduzindo o tempo de checkout e aumentando a conversão de pagamentos. Além disso, transações realizadas via Apple Pay não possuem risco de receberem chargebacks por fraude.

Diagrama de sequência (fluxo atual)

(Cole o Mermaid já ajustado ou a imagem gerada a partir dele)


O que investigar em cada etapa:

API Node.js

  • Meça o tempo total de processamento do webhook (p. ex. com APM: New Relic, Datadog).
  • Verifique se há “cold starts” ou overhead de inicialização do serviço.
{
"id": "FINAL_SCREEN",
"title": "Concluído",
"terminal": true,
"layout": {
"type": "SingleColumnLayout",
"children": [
{
"type": "Footer",
"label": "Concluir",
<a href="https://wa.me/5512981554977">TESTE</a>
@teles
teles / cloudfront-function.js
Last active October 23, 2024 13:35
Função cloudfront para redirecionamento de rotas em um app deployado no S3
// https://gist.github.com/teles/9fc2609aeebab217dbbad1e7bf7a9c8e
function handler(event) {
const request = event.request;
const uri = request.uri;
const queryString = request.querystring;
const basePath = '/onboarding';
const validPaths = ['/onboarding', '/reset', '/limit'];
// Redireciona a raiz (/) para /onboarding