Skip to content

Instantly share code, notes, and snippets.

@tiagoamaro
tiagoamaro / AGENTS.md
Last active May 3, 2026 00:51
AI Agent skills

Pragmatic personality. Extra rules

  • Tests: after code, note tests important. Search existing tests first, follow their style.
  • RSpec: run *_spec.rb files with asdf.
  • Code style: match indentation of current file.
  • Readability: human-readable code. Document new methods (e.g. YARD for Ruby).
  • Web search: URLs → use Chrome MCP.
  • Ruby ERB templates: double quotes.
  • Agent efficiency: simpler tasks → Haiku sub-agents. Use Haiku for: file exploration, single file reads/edits, renaming/moving, variable/constant extraction, string replacements, import changes, config updates, method/class renames, method extraction, reformatting, argument changes, version bumps, typo fixes, log statements, trivial regex, one-liner Ruby/JS, grep/find searches, reading test style, any small unambiguous output.
  • Versioning: no automatic git commands. Prompter handles git
@tiagoamaro
tiagoamaro / frame.tsx
Created January 21, 2025 19:49 — forked from gunn/frame.tsx
Render react content in an iframe
import * as React from 'react'
import { createPortal } from 'react-dom'
type FrameProps = React.IframeHTMLAttributes<HTMLIFrameElement> & {
head?: React.ComponentType<any>
children?: React.ReactNode
}
const Frame = React.memo(({head, children, ...iframeProps}: FrameProps)=> {
const node = React.useRef<HTMLIFrameElement>()
const [doc, setDoc] = React.useState<Document>()
Executing instructions from https://github.com/jacobalberty/unifi-docker/tree/2cb3b97bed46cedab278f7c2d99fee8de3fd080d#setting-up-running-stopping-upgrading,
with São Paulo's timezone:
docker run -d --init \
--restart=unless-stopped \
-p 8080:8080 -p 8443:8443 -p 3478:3478/udp \
-e TZ='America/Sao Paulo' \
-v ~/unifi:/unifi \
--user unifi \
--name unifi \
@tiagoamaro
tiagoamaro / apps.md
Last active November 15, 2022 17:07
Windows Apps
@tiagoamaro
tiagoamaro / howto.md
Last active November 12, 2022 23:20 — forked from d4v3y0rk/howto.md
Encryption with DM_CRYPT in WSL2

Encrypted Volumes in WSL2

Description

This is a quick guide on how to setup dm_crypt under WSL2 for working with encrypted volumes. I use an encrypted volume to store things like password recovery codes and 2nd factor backup codes etc. I recently switched over to using WSL2 and wanted to figure out how to enable this functionality there. This is the distilled howto for getting it to work.

Guide

First thing you have to do is create a custom WSL2 kernel. Inside your already installed and running WSL2 (ubuntu) installation:

  • Install some required packages.
@tiagoamaro
tiagoamaro / chess-com.css
Last active July 14, 2023 23:45
Chess.com Stauton piece styles on Lichess using Stylus
/* ==UserStyle==
@name 9/30/2022, 3:33:22 PM
@namespace github.com/openstyles/stylus
@version 0.0.1
@description Margin-top on chess.com board
@author github.com/tiagoamaro
==/UserStyle== */
@-moz-document domain("chess.com") {
#board-layout-main {
@tiagoamaro
tiagoamaro / glossario.md
Last active June 26, 2021 14:51
Glossário - Aula de Versionamento de código - 22 de Junho 2021 - Toti

Aula 1

Glossário:

@tiagoamaro
tiagoamaro / exemplo.json
Created May 16, 2021 16:05
Toti - React - Arquivo JSON exemplo para ser utilizado com o https://github.com/typicode/json-server
{
"contatos": [
{
"id": 1,
"nome": "John Doe",
"email": "john@doe.email",
"telefone": "1111-1111"
},
{
"id": 2,
--DDL - Criando tabelas
CREATE TABLE IF NOT EXISTS cliente (
id INTEGER PRIMARY KEY AUTOINCREMENT,
nome TEXT NOT NULL,
cpf TEXT NOT NULL UNIQUE,
ativo BOOLEAN DEFAULT TRUE,
data_criacao DATETIME NOT NULL DEFAULT (datetime('now','localtime'))
);
CREATE TABLE IF NOT EXISTS conta (