Skip to content

Instantly share code, notes, and snippets.

@tiagoamaro
tiagoamaro / css-debugger.js
Created July 21, 2026 13:20
CSS debugger bookmarklet: outlines every HTML element with random color per tag, toggle on/off
javascript:/* debug.css | MIT License | zaydek.github.com/debug.css */
if (!("is_debugging" in window)) {
is_debugging = false;
var debug_el = document.createElement("style");
var tag_names = Array.from(new Set(
Array.from(document.querySelectorAll("*"))
.map(function (el) { return el.tagName.toLowerCase(); })
)).filter(function (tag) { return tag !== "g" && tag !== "path"; });
@tiagoamaro
tiagoamaro / AGENTS.md
Last active July 2, 2026 15:38
AI Agent skills

Pragmatic personality. Extra rules

  • GitHub: use gh CLI for PRs, issues, comments, reviews, etc. No direct API calls.
  • Tests: after code, note tests important. Search existing tests first, follow their style.
  • RSpec: run *_spec.rb files with asdf.
  • Rails: when running tests, check Rails test logs for better context
  • 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.
@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,