Skip to content

Instantly share code, notes, and snippets.

View viktormarinho's full-sized avatar
🇧🇷

viktormarinho

🇧🇷
View GitHub Profile
deco create
# Isso cria uma pasta no seu pc, agora entre nela com "cd <NOME_DA_PASTA>"
bun install
bun dev
# Deployar
bun deploy
@viktormarinho
viktormarinho / gist:e7addb319da96a0ba43b4d47e99d3f71
Created October 8, 2025 13:57
Google Cloud Search App - Tarefa de Conclusão
# Google Cloud Search App - Tarefa de Conclusão
## Contexto Geral
Precisamos garantir o funcionamento completo de uma App da Deco chamada **"google-sites"** (localizada no repositório `deco-cx/apps`).
> **Nota sobre nomenclatura**: O nome atual é `google-sites`, mas seria mais apropriado chamá-la de `google-cloud-search`, já que a app contém apenas uma tool para fazer queries no Google Cloud Search. Renomear não é prioridade no momento.
## Objetivo da App
@viktormarinho
viktormarinho / gcp-auth.ts
Created October 2, 2025 19:57
Snippet of code that receives any KV implementation and can be used to manage google cloud service account access key generation/management
import { importPKCS8, SignJWT } from "jose";
import { Buffer } from "node:buffer";
// The scopes you want to use here.
// The service account should be configured to have access to these APIs.
const scopes = ["https://www.googleapis.com/auth/cloud_search.query"];
const GCP_TEMP_ACCESS_TOKEN_KV_KEY =
"google-cloud-auth-temp-access-token";
{"type":"excalidraw/clipboard","elements":[{"type":"rectangle","version":1733,"versionNonce":518710343,"isDeleted":false,"id":"d6e35ea8-1cd6-4784-8912-8e8de6456578","fillStyle":"solid","strokeWidth":2,"strokeStyle":"solid","roughness":1,"opacity":100,"angle":0,"x":1515.598193432759,"y":577.8350506150438,"strokeColor":"#1e1e1e","backgroundColor":"transparent","width":275.48223204145233,"height":59.54426409064803,"seed":1970185349,"groupIds":["9a3166b6-0bc2-4415-8764-181939bb0cde"],"frameId":null,"roundness":{"type":3},"boundElements":[],"updated":1729726760119,"link":null,"locked":false,"customData":{"isAnnotation":false,"widgetId":"c0ab9c77-7eeb-4435-bbcb-dcf014c7483b"}},{"type":"text","version":1705,"versionNonce":1286914919,"isDeleted":false,"id":"c25fd6e3-10b5-453a-bba1-d27f442945a5","fillStyle":"solid","strokeWidth":2,"strokeStyle":"solid","roughness":1,"opacity":100,"angle":0,"x":1530.3192322781538,"y":601.7991090157784,"strokeColor":"#1e1e1e","backgroundColor":"transparent","width":239.63400268554688,"h
import { fetchToCurl } from "jsr:@viktor/fetch-to-curl";
import { ensureDir } from "https://deno.land/std@0.54.0/fs/ensure_dir.ts";
const IS_ENABLED = Deno.env.get("APPS_DEBUG") === "1";
function getCounter(): number {
let counter = 1;
for (const _ of Deno.readDirSync("./debug")) {
counter++;
}
@viktormarinho
viktormarinho / report.md
Created April 4, 2024 16:05
Deno lsp status

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [
    "./_fresh",
    "./.vscode",
@viktormarinho
viktormarinho / settings.json
Created May 14, 2023 17:08
vscode settings.json (really nice)
{
"workbench.iconTheme": "vscode-icons",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.formatOnType": true
},
"workbench.startupEditor": "none",
"editor.minimap.enabled": false,
"editor.inlayHints.enabled": "off",
http://10.109.71.7:5173/
{
"watch": [
"src"
],
"ext": ".ts,.js",
"ignore": [],
"exec": "ts-node ./src/index.ts"
}