Skip to content

Instantly share code, notes, and snippets.

View victorcolina22's full-sized avatar
🚀
Focusing

Victor Colina victorcolina22

🚀
Focusing
View GitHub Profile
@victorcolina22
victorcolina22 / doc.md
Last active January 3, 2026 05:27
Crea tu propio Pie Chart con React + TypeScript + TailwindCSS

Custom hook for React to manage form states

Install TanStack Query to properly use

npm i @tanstack/react-query

Also you need to copy and paste this function in your project to enable the comparation

export const deepCompare = (objA: any, objB: any) => {

Deep compare function in TypeScript

export const deepCompare = (objA: any, objB: any) => {
	if (objA === objB) return true; // Misma referencia o valores primitivos

	if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
		return false; // Ningún objeto es null
	}

Commands to find and kill ports running on MacOS

View ports listening

sudo lsof -nP -iTCP -sTCP:LISTEN

View port listening on port provided

lsof -i :3000

Comandos para mantener pantalla activa al cerrar laptop desenchufada MacOS

Ver configuración de hibernación

pmset -g | grep hibernatemode

Setear configuración para mantener pantalla activa

sudo pmset -a sleep 0

Template para levantar contenedor en docker con PostgreSQL

version: "3"

services:
  myDB:
    image: postgres:latest
    container_name: my-database
 restart: always

Add custom commands for iTerm + ZSH.

  1. Create new file and name .my_custom_commands.sh
  2. Add some functions e.g
function ios() {
  open -a "Xcode" ~/Documents/iOS/MyiOSProject.xcodeproj
}

Prettier config JSON for astro

{
  "arrowParens": "always",
  "bracketSameLine": false,
  "objectWrap": "preserve",
  "bracketSpacing": true,
  "semi": true,
 "experimentalOperatorPosition": "end",

Command to search for a file in the system macOS

sudo find / -name nombre-de-archivo 2>/dev/null
@victorcolina22
victorcolina22 / folder-structure.md
Last active March 9, 2025 16:35
Folder structure for React Native project with Expo example

React Native folder structure with Expo

proyecto-app/
├── .expo/
├── .github/                   # Configuración para CI/CD y GitHub Actions
├── assets/                    # Recursos estáticos
│   ├── fonts/
│   ├── images/
│   └── animations/            # Animaciones Lottie