Skip to content

Instantly share code, notes, and snippets.

View rafa-thayto's full-sized avatar
☯️
living one day at a time

Rafael Thayto rafa-thayto

☯️
living one day at a time
View GitHub Profile
@rafa-thayto
rafa-thayto / keybindings.json
Last active June 13, 2025 03:51
My Cursor/VSCode/Windsurf settings with VIM
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+i",
"command": "composerMode.agent"
},
{
"key": "y",
"command": "filesExplorer.copy",
"when": "explorerViewletFocus && !inputFocus"
@rafa-thayto
rafa-thayto / typebox-helper.ts
Created October 8, 2024 04:11
Typebox date, date-time, time, email, uuid, url, ipv4, ipv6 helper
import { FormatRegistry } from "@sinclair/typebox";
export const setupFormatRegistry = () => {
FormatRegistry.Set("date-time", (value) => IsDateTime(value, true));
FormatRegistry.Set("date", (value) => IsDate(value));
FormatRegistry.Set("time", (value) => IsTime(value));
FormatRegistry.Set("email", (value) => IsEmail(value));
FormatRegistry.Set("uuid", (value) => IsUuid(value));
FormatRegistry.Set("url", (value) => IsUrl(value));
FormatRegistry.Set("ipv6", (value) => IsIPv6(value));
@rafa-thayto
rafa-thayto / nvim-events.md
Created May 11, 2024 22:34 — forked from dtr2300/nvim-events.md
Overview of Nvim Events

Nvim Events

Nvim recognizes the following events. Names are case-insensitive.

BufAdd
Just after creating a new buffer which is
added to the buffer list, or adding a buffer
@rafa-thayto
rafa-thayto / script.sh
Created April 26, 2024 22:39
This script gets some output at the end of the cli execution
yes | somectl credentials generate -d some-thing -t foo -e bar | sed "s/Generating credentials//" | awk '{print $1}'
@rafa-thayto
rafa-thayto / .swcrc
Created March 6, 2024 20:05
Jest config with swc and typescript
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"target": "es2020",
"baseUrl": ".",
"parser": {
"syntax": "typescript",
"tsx": false,
"dynamicImport": true
},
@rafa-thayto
rafa-thayto / Dockerfile
Last active March 4, 2024 03:51
Lightweight Dockerfile for nodejs apps with multi-staged builds
# Base image
FROM node:PUT_THE_IMAGE_HERE AS base
# Install dependencies
FROM base as deps
WORKDIR /app
# ARG GH_TOKEN
# Change the registry if needed
@rafa-thayto
rafa-thayto / testcontainer.example.spec.ts
Created February 21, 2024 17:12
Simple nodejs testcontainer implementation with Redis and typescript
import { RedisClientType, createClient } from 'redis';
import {
GenericContainer,
Network,
RandomUuid,
StartedTestContainer,
StoppedTestContainer,
} from 'testcontainers';
describe('Redis', () => {
@rafa-thayto
rafa-thayto / docker-compose.yaml
Created February 20, 2024 20:24
Docker Compose file example with zookeper + 3 kafka brokers + schema registry + custom network
version: "3.7"
services:
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
platform: linux/arm64
ports:
- 8080:8080
depends_on:
@rafa-thayto
rafa-thayto / keychron_k2.adoc
Created August 18, 2023 01:31 — forked from judaew/keychron_k2.adoc
Keychron K2 Manual

Keychron K2 Manual

Connect Bluetooth

On the side of the keyboard, switch the toggle to Bluetooth. Press fn+1 3 seconds and pair with device named Keychron K2.

  • fn+1 connect to 1st device

  • fn+2 connect to 2nd device

  • fn+3 connect to 3rd device

Configuração do ReScript

bsconfig.json:

{
  "name": "my-rescript-app",
  "reason": { "react-jsx": 3 },
  "sources": [
 {