# Note

id: cmn223irx0002jhl2znskgydu
title: Git commit with message
type: command
creationSource: form
content:
  ## Comando

  git commit -m "fix: resolve bug"

  ## Qué hace

  Creates a commit with a message

  ## Ejemplo

  ```bash
  git commit -m "feat: add new feature"
  ```


id: cmn223is10005jhl2cgdsjaq9
title: Docker remove all containers
type: command
creationSource: form
content:
  ## Comando

  docker rm -f $(docker ps -aq)

  ## Qué hace

  Force removes all containers

  ## Ejemplo

  ```bash
  docker rm -f $(docker ps -aq)
  ```


id: cmn223is40008jhl2psd32fre
title: Find files modified today
type: command
creationSource: form
content:
  ## Comando

  find . -type f -mtime 0

  ## Qué hace

  Finds files modified in the last 24 hours

  ## Ejemplo

  ```bash
  find . -type f -mtime -1
  ```


id: cmn223is7000bjhl2jpo8t2xq
title: Kill process on port
type: command
creationSource: form
content:
  ## Comando

  lsof -ti:<port> | xargs kill -9

  ## Qué hace

  Kills process running on specified port

  ## Ejemplo

  ```bash
  lsof -ti:3000 | xargs kill -9
  ```


id: cmn223is9000djhl2x2sdotpb
title: Git undo last commit
type: command
creationSource: form
content:
  ## Comando

  git reset --soft HEAD~1

  ## Qué hace

  Undoes the last commit keeping changes staged

  ## Ejemplo

  ```bash
  git reset --soft HEAD~1
  ```


id: cmn223isc000gjhl2t7p39rqb
title: NPM install specific version
type: command
creationSource: form
content:
  ## Comando

  npm install <package>@<version>

  ## Qué hace

  Installs a specific version of a package

  ## Ejemplo

  ```bash
  npm install lodash@4.17.21
  ```


id: cmn223isf000jjhl2t252itxe
title: Rsync with ssh
type: command
creationSource: form
content:
  ## Comando

  rsync -avz -e ssh source/ user@host:dest/

  ## Qué hace

  Syncs files via SSH

  ## Ejemplo

  ```bash
  rsync -avz -e ssh ./data/ user@server:/backup/
  ```


id: cmn223isi000mjhl2eh4dcbml
title: React useState hook
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  typescript

  ## Código

  ```typescript
  const [state, setState] = useState(initialValue)
  ```

  ## Descripción

  Basic React state hook usage


id: cmn223isl000ojhl2j9onx7ch
title: Python list comprehension
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  python

  ## Código

  ```python
  squares = [x**2 for x in range(10)]
  ```

  ## Descripción

  Create list of squares using comprehension


id: cmn223iso000rjhl2zlpi3a85
title: CSS flexbox centering
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  css

  ## Código

  ```css
  display: flex;
  justify-content: center;
  align-items: center;
  ```

  ## Descripción

  Center element horizontally and vertically


id: cmn223iss000ujhl2zpfnmgew
title: JavaScript async await
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  javascript

  ## Código

  ```javascript
  const result = await fetchData()
  console.log(result)
  ```

  ## Descripción

  Async/await pattern for Promises


id: cmn223isw000xjhl22xiv1ojo
title: SQL SELECT with JOIN
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  sql

  ## Código

  ```sql
  SELECT n.*, t.name as tag
  FROM notes n
  JOIN note_tags nt ON n.id = nt.note_id
  JOIN tags t ON nt.tag_id = t.id
  ```

  ## Descripción

  Join notes with tags


id: cmn223isx000zjhl2g3jftf91
title: Go error handling
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  go

  ## Código

  ```go
  if err != nil {
      return fmt.Errorf("failed: %w", err)
  }
  ```

  ## Descripción

  Standard Go error handling with wrapping


id: cmn223it00012jhl2i8fu8fjt
title: Bash function
type: snippet
creationSource: form
content:
  ## Snippet

  ## Lenguaje

  bash

  ## Código

  ```bash
  function greet() {
      echo "Hello, $1!"
  }
  ```

  ## Descripción

  Basic bash function with parameter


id: cmn223it30016jhl2db7yq2h1
title: Use PostgreSQL over MySQL
type: decision
creationSource: form
content:
  ## Contexto

  Need a relational database for the backend API

  ## Decisión

  Chose PostgreSQL for its advanced features

  ## Alternativas consideradas

  MySQL - simpler but less features
  SQLite - embedded, not for production

  ## Consecuencias

  Better data integrity, JSON support, Full-text search built-in


id: cmn223it8001ajhl203wrlmvw
title: Use Next.js App Router
type: decision
creationSource: form
content:
  ## Contexto

  Starting a new full-stack project

  ## Decisión

  Next.js with App Router for server components

  ## Alternativas consideradas

  Express - more control but manual setup
  Remix - good but smaller ecosystem

  ## Consecuencias

  Better SEO, easier deployment, React Server Components


id: cmn223itb001djhl20qdolllq
title: Use TypeScript strict mode
type: decision
creationSource: form
content:
  ## Contexto

  Setting up a new TypeScript project

  ## Decisión

  Enable strict mode from the start

  ## Alternativas consideradas

  Disable strict initially - leads to tech debt

  ## Consecuencias

  Catches errors early, better code quality


id: cmn223itd001gjhl25et0pldc
title: Use Tailwind CSS
type: decision
creationSource: form
content:
  ## Contexto

  Need a styling solution for React project

  ## Decisión

  Tailwind CSS for rapid development

  ## Alternativas consideradas

  Styled Components - runtime overhead
  CSS Modules - more setup

  ## Consecuencias

  Faster development, consistent design, smaller bundle


id: cmn223iti001kjhl236ozj19m
title: Pasta carbonara
type: recipe
creationSource: form
content:
  ## Ingredientes

  - 400g spaghetti
  - 200g guanciale
  - 4 egg yolks
  - 100g pecorino romano
  - Black pepper

  ## Pasos

  1. Cook pasta in salted water
  2. Cut guanciale into cubes
  3. Fry guanciale until crispy
  4. Mix egg yolks with cheese
  5. Combine hot pasta with guanciale
  6. Add egg mixture off heat
  7. Toss until creamy

  ## Tiempo

  20 minutes


id: cmn223itl001njhl2bwc12a07
title: Guacamole
type: recipe
creationSource: form
content:
  ## Ingredientes

  - 3 avocados
  - 1 lime
  - 1 onion
  - 2 tomatoes
  - Cilantro
  - Salt

  ## Pasos

  1. Cut avocados and mash
  2. Dice onion and tomatoes finely
  3. Add lime juice
  4. Chop cilantro
  5. Mix all ingredients
  6. Season to taste

  ## Tiempo

  10 minutes


id: cmn223ito001qjhl25x6ok3sc
title: Chicken stir fry
type: recipe
creationSource: form
content:
  ## Ingredientes

  - 500g chicken breast
  - 2 bell peppers
  - 1 broccoli
  - Soy sauce
  - Ginger
  - Garlic

  ## Pasos

  1. Cut chicken into strips
  2. Chop vegetables
  3. Stir fry chicken until cooked
  4. Add vegetables
  5. Add soy sauce and spices
  6. Serve with rice

  ## Tiempo

  25 minutes


id: cmn223itu001ujhl244xurgti
title: Deploy to Vercel
type: procedure
creationSource: form
content:
  ## Objetivo

  Deploy Next.js app to Vercel production

  ## Pasos

  1. Push changes to main branch
  2. Wait for CI to pass
  3. Go to Vercel dashboard
  4. Click Deployments
  5. Select latest deployment
  6. Click Promote to Production
  7. Verify with production URL

  ## Requisitos

  - Vercel account connected
  - GitHub repository linked
  - Production branch protected


id: cmn223itx001xjhl2xsneik2d
title: Setup Git hooks
type: procedure
creationSource: form
content:
  ## Objetivo

  Configure pre-commit hooks with husky

  ## Pasos

  1. Install husky: npm install husky
  2. Init: npx husky install
  3. Add pre-commit: npx husky add .husky/pre-commit "npx lint-staged"
  4. Configure lint-staged in package.json
  5. Test by committing

  ## Requisitos

  - Git repository initialized
  - Package.json configured


id: cmn223iu20021jhl244lzo17z
title: Database backup
type: procedure
creationSource: form
content:
  ## Objetivo

  Create a backup of the production database

  ## Pasos

  1. Connect to production server
  2. Run pg_dump command
  3. Save to timestamped file
  4. Copy to backup storage
  5. Verify backup integrity
  6. Delete backups older than 30 days

  ## Requisitos

  - SSH access to server
  - Sufficient disk space
  - Backup storage configured


id: cmn223iu50024jhl25y2vzswk
title: Code review process
type: procedure
creationSource: form
content:
  ## Objetivo

  Standardize code review workflow

  ## Pasos

  1. Create feature branch
  2. Write code and tests
  3. Open PR with description
  4. Request review from teammate
  5. Address feedback
  6. Get approval
  7. Squash and merge

  ## Requisitos

  - GitHub configured
  - CI passing
  - At least 1 approval


id: cmn223iu80027jhl2k7hn1xic
title: Laptop specs
type: inventory
creationSource: form
content:
  ## Item

  MacBook Pro 16" 2023

  ## Cantidad

  1

  ## Ubicación

  Home office desk

  ## Notas

  - M3 Pro chip
  - 18GB RAM
  - 512GB SSD
  - Serial: ABC123XYZ


id: cmn223iuj002fjhl2oiky6ciu
title: Project ideas
type: note
creationSource: form
content:
  ## Notas

  - Build a weather app with geolocation
  - Create a recipe manager
  - Design a habit tracker
  - Develop a markdown editor


id: cmn223ium002ijhl2ar88ikjz
title: Books to read
type: note
creationSource: form
content:
  ## Notas

  1. Clean Code - Robert Martin
  2. Design Patterns - Gang of Four
  3. The Pragmatic Programmer
  4. Domain-Driven Design


id: cmn223iuo002ljhl21dt4ymgw
title: Conference notes
type: note
creationSource: form
content:
  ## Notas

  Key takeaways from React Conf:
  - Server Components are the future
  - Suspense for streaming
  - Better error boundaries


id: cmn223iur002ojhl2pkq49c60
title: Docker compose template
type: note
creationSource: form
content:
  ## Notas

  Basic docker-compose.yml structure for web apps:
  - App service
  - Database service
  - Redis service
  - Nginx reverse proxy


id: cmn223iut002rjhl2vyvsj1wo
title: API design principles
type: note
creationSource: form
content:
  ## Notas

  - RESTful conventions
  - Use nouns, not verbs
  - Version your APIs
  - Return proper status codes
  - Pagination for lists


id: cmn223iuv002ujhl2lixetudq
title: Git branching strategy
type: note
creationSource: form
content:
  ## Notas

  - main: production
  - develop: staging
  - feature/*: new features
  - bugfix/*: fixes
  - hotfix/*: urgent production fixes


id: cmn223iuy002xjhl2l488e11h
title: Keyboard shortcuts VSCode
type: note
creationSource: form
content:
  ## Notas

  - Cmd+D: Select next occurrence
  - Cmd+Shift+L: Select all occurrences
  - Cmd+P: Quick open file
  - Cmd+Shift+P: Command palette


id: cmn223iv10030jhl2ug2hipy2
title: CSS Grid cheatsheet
type: note
creationSource: form
content:
  ## Notas

  grid-template-columns: repeat(3, 1fr)
  grid-gap: 1rem
  place-items: center
  grid-area: header / sidebar / content / footer


id: cmn223iv30033jhl2rqkne00i
title: React hooks cheatsheet
type: note
creationSource: form
content:
  ## Notas

  - useState: local state
  - useEffect: side effects
  - useCallback: memoize function
  - useMemo: memoize value
  - useRef: mutable ref


id: cmn223iv60036jhl2urpiqxn7
title: Linux commands cheatsheet
type: note
creationSource: form
content:
  ## Notas

  - chmod +x: make executable
  - chown user:group: change owner
  - grep -r: recursive search
  - tar -czvf: compress
  - ssh -i key: connect with key


id: cmn223iv80039jhl2mun8jo0j
title: SQL joins explained
type: note
creationSource: form
content:
  ## Notas

  - INNER: matching in both
  - LEFT: all from left + matching from right
  - RIGHT: all from right + matching from left
  - FULL: all from both
  - CROSS: Cartesian product


id: cmn223iv9003bjhl29jbl4dgx
title: TypeScript utility types
type: note
creationSource: form
content:
  ## Notas

  - Partial: all optional
  - Required: all required
  - Pick: select fields
  - Omit: exclude fields
  - Record: key-value object
  - Exclude: remove from union


id: cmn223ivi003kjhl2iw9u8288
title: Docker vs Kubernetes
type: note
creationSource: form
content:
  ## Notas

  Docker: containerize apps
  Kubernetes: orchestrate containers at scale

  Docker Compose: local multi-container
  K8s: production container orchestration


id: cmn223ivn003ojhl2ohbizghk
title: JWT structure
type: note
creationSource: form
content:
  ## Notas

  Header: algorithm, type
  Payload: claims, exp, iss
  Signature: verify authenticity

  Never store sensitive data in JWT payload


id: cmn223ivq003rjhl2oqudyq7c
title: Web security headers
type: note
creationSource: form
content:
  ## Notas

  - Content-Security-Policy
  - X-Frame-Options
  - X-Content-Type-Options
  - Strict-Transport-Security
  - CORS


