Skip to content

Instantly share code, notes, and snippets.

View imroca's full-sized avatar
👾
En taro Adun Executor

Ignacio Rojas imroca

👾
En taro Adun Executor
View GitHub Profile
@imroca
imroca / jsconfig.json
Created April 16, 2025 21:02
Node path aliasing
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"#*": [
"./src/*"
]
}
}
}
@imroca
imroca / api-client.ts
Last active June 9, 2025 16:54
Axios Api Client
import Axios, { isAxiosError } from "axios";
import type {
CreateAxiosDefaults,
AxiosInstance,
AxiosResponse,
InternalAxiosRequestConfig,
} from "axios";
export const createApiClient = (config: CreateAxiosDefaults): AxiosInstance => {
const api = Axios.create(config);
@imroca
imroca / .my.cnf
Last active October 23, 2025 14:00
MySQL Client Config
[client]
user=dbuser
password=dbpassword
host=dbhost
database=dbname
[mysql]
pager=less -n -i -S -F -X
prompt="@\u [\d] → "
@imroca
imroca / schema.ts
Last active June 17, 2026 16:04
Paraguayan Zod MSISDN / Cellphone Schema Validator
import { z } from "zod";
const paraguayMobileRegex =
/^(?:(?:\+?595|0)9|9?)(?:8[1-7]|7[1-6]|9[1-5]|6[1-3])\d{6}$/;
export const paraguayPhoneSchema = z
.string()
.trim()
.regex(paraguayMobileRegex, "Número de celular paraguayo inválido")
.transform((val) => {
@imroca
imroca / typed-fetch-matt.ts
Created August 3, 2026 23:40
Building a type-safe fetch in #typescript by @mattpocockuk
export const get = async (
url: string,
input: Record<string, string>
) => {
return fetch(
`${url}?${new URLSearchParams(input).toString()}`
);
};
export const post = async (