chore: add files from master-wiki repo

This commit is contained in:
Alexander Navarro 2024-11-20 20:00:35 -03:00
parent f99a9ae2ac
commit 1847f6bf28
315 changed files with 1047341 additions and 0 deletions

View file

@ -0,0 +1,8 @@
---
created: 2024-02-28 13:18
updated: 2024-03-12 13:49
---
| Library | Description |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [shadcn/ui](https://ui.shadcn.com/) | Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source. |

View file

@ -0,0 +1,30 @@
---
created: 2024-04-15 20:56
updated: 2024-04-15 20:56
---
# Devtools
List of tools to solve common problems
## Tasks Runners
- [Overseer](https://github.com/stevearc/overseer.nvim): nvim task management
## Debugging
- [debugprint.nvim](https://github.com/andrewferrier/debugprint.nvim): manage print statements with useful information inside neovim
## Nvim Tools
### Focus Mode
- [Zen mode](https://github.com/folke/zen-mode.nvim): focus on the current portion of a file only
### Codebase Navigation
- Telescope
- [Graple](https://github.com/stevearc/overseer.nvim), bookmarks files to instant navigation in 1 key chord
### File Navigation
- [flash.nvim](https://github.com/folke/flash.nvim): jump to any place, enhances search, `f`,`F`,`t`,`T`, motions

View file

@ -0,0 +1,17 @@
# Docker
## Publish Container Images
To easily create multi-arch containers and publish them to a registry, use this snipped (note you need to be logged in the registry):
Create builder container:
```bash
docker buildx create --name mybuilder --use --bootstrap
```
Build and publish image:
```bash
docker buildx build --push \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/<name-space>/<image>:latest .
```

View file

@ -0,0 +1,9 @@
---
created: 2024-02-20 11:39
updated: 2024-03-12 13:49
---
When a feature or module is shipt, I need to asure the following things before submiting:
- Clean & readable code
- Linter without errors
- Design is as close as posible to the proposal

View file

@ -0,0 +1,25 @@
---
created: 2024-02-20 11:27
updated: 2024-03-12 13:49
tags:
- dev-tools
---
# Fix messy commits
Ya que estas opciones sobre escriben el historial de git, solo deben aplicarse en local y no commits publicados a un remote.
Como alternativa se puede intentar actualizar el historial remoto siempre y cuando el historial sea igual al local (osea, nosotros fuimos los últimos en actualizarlo y nadie ha hecho nada más). Para esto utilizamos `git push --force-with-lease`.
## Last commit
Si solo necesitamos agregar un cambio pequeño al ultimo commit (typo o correr el formatter), podemos aplicarlo con `git commit --ammend`, se puede sobre escribir el mensaje con `-m`.
## Mutiple commits
Se pueden arreglar el historial de commits con un `git rebase -i [since commit or branch]` y utilizar las estrategias de pick, squash, reword y drop.
En caso de que sepamos que haremos un commit que luego no necesitaremos, podemos hacer:
- `git commit --fixup [commit hash]` -> descarta el commit message de este commit y mantiene el del commit de referencia
- `git commit --squash [commit hash]` -> git juntará los mensajes de todos los commits a hacer squash y el commit de referencia.
Finalmente podemos hacer `git rebase -i --autosquash` y git eligirá las opciones necesarias a tomar en vez de tener que hacerlo de manera manual.

View file

@ -0,0 +1,14 @@
---
created: 2024-02-13 22:36
updated: 2024-03-12 13:49
tags:
- dev-tools
---
![Git Merge vs Rebase vs Squash ¿Qué estrategia debemos elegir](2023-11-04%20-%20Git%20Merge%20vs%20Rebase%20vs%20Squash%20¿Qué%20estrategia%20debemos%20elegir-.md#notes)
![Utilizar `git bisect`](Search%20for%20a%20bug.md#Utilizar%20`git%20bisect`)
![Fix messy commits](Fix%20messy%20commits.md)
![Revert old changes in a codebase](Revert%20old%20changes%20in%20a%20codebase.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

View file

@ -0,0 +1,65 @@
# So You Think You Know Git Part 2 - DevWorld 2024
## Switch and Restore
Wrapper around the `checkout` command to make more sense. You can do:
- `git switch branch` instead of `git checkout bracnh`
- `git restore file.txt` instead of `git checkout file.txt`
![](Pasted%20image%2020240417084933.png)
## Git Hooks
![](Pasted%20image%2020240417084959.png)
useful ones:
![](Pasted%20image%2020240417085036.png)
uses:
- Commit message formatting
- package install
- update ctags
- submodule status
- tabs or spaces
- linting
- large files
- test passes
Helpers (installable external tools):
- pre-commits
- husky
## Attributes
run files through intermediates and diff that:
```bash
echo '*.png diff=lexif' >> .gitattributes
git config diff.exif.textconv exiftool
```
## Fixup Commits
`git commit --fixup=<commit>`
`git rebase --autosquash`
## Rebasing Stacks
move dangling branches reference when doing a rebase
`git rebase --update-refs`
## Scaling Git
top level command `scalar`, it's only used to clone huge repositories.
## Worktrees
- working on more than one branch at a time
- provide a new working directory to each branch
![](https://www.youtube.com/watch?v=Md44rcw13k4)

View file

@ -0,0 +1,24 @@
---
created: 2024-02-20 11:43
updated: 2024-03-12 13:49
---
## How to make an Iframe 100% it's parent width while maintaining the aspect ratio
In this example, we need to wrap the iframe in a container class and provide the following styles:
```css
.container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
```

View file

@ -0,0 +1,15 @@
---
created: 2024-02-20 11:34
updated: 2024-03-12 13:49
tags:
- dev-tools
---
## Revertir cambios
Si necesitamos _"deshacer"_ los cambios introducidos en uno o multiples commits, podemos utilizar `git revert --no-edit older_commit_hashˆ..newer_commit_hash`, donde:
- git realizará un nuevo commit con los cambios contrarios por cada commit en el rango
- utilizar `ˆ` en el `old_commit_hash` incluirá ese commit en la reversión de cambios, si no se agrega se empezará a revertir de un commit más adelante.
- `--no-edit` es utilizado para que git no nos pregunte por el message de cada nuevo commit
- primero debe ser el commit más antiguo, porque git creará nuevos commits en orden provisto y de hacerlo al revés aparecerán conflictos
- si solo se quiere revertir un commit, se puede especificar solo ese hash

View file

@ -0,0 +1,9 @@
---
created: 2024-02-20 11:35
updated: 2024-03-12 13:49
---
# Buscar cuando un bug se introdujo
## Utilizar `git bisect`
`git bisect` hará un _"binary search"_ entre 2 commits, dejandonos señalar si este commit es _"bueno"_ (no tiene el bug) o _"malo"_ (tiene el bug), permitiendo encontrar el commit que introdujo el bug y facilitar encontrar la causa de este.