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 / init.lua
Created January 18, 2025 19:39
ChatGPT Minimal nvim config
-- Basic settings
vim.opt.number = true -- Show line numbers
vim.opt.relativenumber = true -- Show relative line numbers
vim.opt.clipboard = "unnamedplus" -- Enable system clipboard integration
vim.opt.expandtab = true -- Use spaces instead of tabs
vim.opt.shiftwidth = 4 -- Number of spaces per indentation
vim.opt.tabstop = 4 -- Number of spaces for a tab
vim.opt.termguicolors = true -- Enable true color support
vim.opt.wrap = false -- Disable line wrapping
vim.opt.swapfile = false -- Disable swap file creation
@imroca
imroca / validate.ts
Last active May 24, 2024 02:11
Validate Auth0 id_token
import jwt from "jsonwebtoken";
import jwksClient from "jwks-rsa";
const idToken = "<idtoken>";
const decoded = jwt.decode(idToken, { complete: true }) as any;
const { kid } = decoded.header;
const { iss } = decoded.payload;
const response = await fetch(
@imroca
imroca / node-setup-guide.txt
Last active April 20, 2024 15:08
Setup a Node Project Guide
PROJECT_NAME="" # my-app
MAIN="" # index.mjs
# npm config set init-author-name "Your name"
# npm config set init-author-email "Your email"
# npm config set init-license "MIT"
# npm config set init-version "0.1.0"
mkdir $PROJECT_NAME
cd $PROJECT_NAME
@imroca
imroca / logger.js
Last active February 9, 2024 22:39
Small logging utilities setup.
import pc from "picocolors";
// Assign colors.
export const success = pc.green;
export const ok = pc.green;
export const info = pc.cyan;
export const msg = pc.blue;
export const message = pc.blue;
export const notice = pc.magenta;
export const spam = pc.gray;
@imroca
imroca / .tmux.config
Created January 10, 2024 18:55
Minimal Tmux Config
set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -s escape-time 10
set -sg repeat-time 600
set -s focus-events on
set -g prefix2 C-a
bind C-a send-prefix -2
set -q -g status-utf8 on
setw -q -g utf8 on
set -g history-limit 5000
@imroca
imroca / .vimrc
Last active January 10, 2024 18:55
Minimal Vim Config
set backspace=2 " backspace in insert mode works like normal editor
set shiftwidth=2 " indent by 2 spaces when auto-indenting
set softtabstop=2 " indent by 2 spaces when hitting tab
syntax on " syntax highlighting
filetype indent on " activates indenting for files
set autoindent " auto indenting
set number " line numbers
colorscheme desert " colorscheme desert
set nobackup " get rid of anoying ~file
@imroca
imroca / settings.json
Created November 8, 2022 19:26
Visual Studop Code - User Settings - Minimalist Config
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@imroca
imroca / logme.php
Created February 5, 2022 19:42
PHP Simple Logging function
// Simple log
function logme($data, $group = 'default')
{
$type = strtolower(gettype($data));
$message = '';
if (in_array($type, ['object', 'array', 'resource', 'resource (closed)'])) {
$message = print_r($data, true);
} elseif (in_array($type, ['boolean', 'null', 'unknown type'])) {
$message = var_export($data, true);
} else {
@imroca
imroca / composer.json
Last active July 8, 2022 19:22
Write command line scripts with PHP and my favorite dependencies
{
"name": "ignacio/commandlineme",
"description": "Command line scripts with PHP",
"type": "project",
"require": {
"aws/aws-sdk-php": "^3.184",
"guzzlehttp/guzzle": "^7.3",
"illuminate/database": "^8.47",
"illuminate/http": "^8.63",
"laravel/helpers": "^1.4",