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
@alvseven
alvseven / custom-error-map.ts
Last active September 15, 2024 00:19
Zod custom error map
import { type ZodErrorMap, z } from 'zod';
// Error map
type Error = Parameters<ZodErrorMap>['0'];
type Ctx = Parameters<ZodErrorMap>['1'];
type Field = string | number | undefined;
export class ZodCustomErrorMap {
public errorMap(error: Error, ctx: Ctx) {
@Velrok
Velrok / kitty.conf
Created August 30, 2023 10:40
symbol_map config for kitty terminal using Symbols Nerd Font Mon as fallback font for icons
# https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
symbol_map U+E5FA-U+E62B Symbols Nerd Font Mono
# Devicons
symbol_map U+e700-U+e7c5 Symbols Nerd Font Mono
# Font Awesome
symbol_map U+f000-U+f2e0 Symbols Nerd Font Mono
# Font Awesome Extension
symbol_map U+e200-U+e2a9 Symbols Nerd Font Mono
# Material Design Icons
symbol_map U+f0001-U+f1af0 Symbols Nerd Font Mono
@dtr2300
dtr2300 / nvim-events.md
Last active February 8, 2026 07:56
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
@pjobson
pjobson / setup_cypress_wsl2.md
Last active May 29, 2025 18:10
Setting Up Cypress on Ubuntu WSL2
@fdaciuk
fdaciuk / Live Node.js + TS com Programação Funcional.md
Last active January 29, 2025 18:17
Live Node.js + TS com Programação Funcional
@fdaciuk
fdaciuk / How to use async await without try-catch block.md
Last active September 25, 2024 23:55
How to use async/await without try/catch block

How to use async/await without try/catch block

We can use something like this:

async function resolveToNumber () {
  const promise = Promise.resolve(1)
  const [error, result] = await to(promise)
  console.log(error, result) // [null, 1] -> Here we have the result, and error will be null
}
@judaew
judaew / keychron_k2.adoc
Last active December 22, 2025 03:31
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

@rafa-thayto
rafa-thayto / .gitconfig
Last active February 24, 2022 01:03
.gitconfig alias
[alias]
a = add
co = checkout
sw = switch
ci = commit
st = status
br = branch
ps = push
ac = "!git add . && git commit -m"
fp = "!git fetch && git pull && git push"
@n3dst4
n3dst4 / renaming.markdown
Last active January 13, 2025 16:46
How to rename Visual Studio solutions and projects

How to rename solutions and projects in Visual Studio

  1. Don't.

How to rename solutions and projects that were created in Visual Studio

  1. Close Visual Studio and don't open it again until I tell you. Visual Studio is not competent at renaming things.
  2. Assuming you're using git, clean the working folder to remove anything that's not in version control (this will help the search-and-replace step because it won't have to go through a bunch of generated files)

git clean -fdx

@Bekbolatov
Bekbolatov / tmux.md
Last active August 27, 2025 10:57
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session