Skip to content

Instantly share code, notes, and snippets.

View beatrizsmerino's full-sized avatar
🏠
Working from home

Beatriz Sopeña Merino beatrizsmerino

🏠
Working from home
View GitHub Profile
@beatrizsmerino
beatrizsmerino / horas-claude.sh
Created April 12, 2026 22:04
Calcula horas reales de jornada con Claude Code (detecta sueño con pausas >=4h)
#!/usr/bin/env bash
# Uso: horas-claude.sh [YYYY-MM-DD] (por defecto: hoy)
DAY="${1:-$(date +%Y-%m-%d)}"
python3 - "$DAY" <<'PY'
import json, glob, sys
from datetime import datetime, timezone, timedelta
day = datetime.strptime(sys.argv[1], "%Y-%m-%d").date()
local = datetime.now().astimezone().tzinfo
@beatrizsmerino
beatrizsmerino / claude_desktop_config.json
Last active January 29, 2026 12:18
Tutorial: Cómo crear un MCP Server en TypeScript con un tool de clima usando Open-Meteo API
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"-y",
"tsx",
"/ruta/a/tu/proyecto/01-start/main.ts"
]
}
@beatrizsmerino
beatrizsmerino / nvm-auto-switch.sh
Created January 15, 2026 10:17
ZSH script to automatically switch Node.js version based on .nvmrc file
#!/bin/zsh
# =============================================================================
# NVM Auto-Switch
# =============================================================================
# Automatically switches Node.js version when entering a directory with .nvmrc
#
# Features:
# - Detects .nvmrc file in current directory
# - Installs Node version if not available
# - Switches to the specified version automatically
@beatrizsmerino
beatrizsmerino / _vsc-instructions-extensions.md
Last active June 4, 2024 05:36
Extensions of Visual Studio Code

Como exportar e instalar extensiones de Visual Studio Code (VSC)

Para generar el archivo extensions.json con las extensiones que tienes instaladas en Visual Studio Code, necesitas ejecutar los siguientes pasos:

1. Crear una lista de las extensiones instaladas en un archivo txt

Abre una Terminal y ejecuta el siguiente comando, para crear el archivo extensions.txt en la ubicación actual de la Terminal:

code --list-extensions &gt; extensions.txt
@beatrizsmerino
beatrizsmerino / _vsc-instructions-shortcuts.md
Last active March 13, 2023 23:47
Shortcuts of Visual Studio Code

Atajos de teclado de Visual Studio Code (VSC)

Atajos útiles para navegar por menús de VSC

  • Abrir el menú del explorador de archivos y alternar foco entre el explorador y el archivo en el que estábamos
    • Con las teclas navegamos hacia arriba y hacia abajo entre el árbol de archivos y carpetas
    • Con las teclas entramos y salimos de los directorios.
    • Con la tecla espacio abrimos un archivo.

| Mac | Windows |

@beatrizsmerino
beatrizsmerino / folder-files.txt
Last active March 13, 2023 23:46
Commands Git
FOLDERS & FILES
---------------------------
-> Entrar dentro de un directorio
cd <nameFolder>
@beatrizsmerino
beatrizsmerino / svgMe-javascriptES5.js
Last active March 13, 2023 23:46
Function 'svgMe' with jquery and vanilla javascript. This function converts an `<img>` tag, with a `.svg` extention and a class `svgMe`, into a `<svg>` tag. Example: https://codepen.io/beatrizsmerino/pen/pooMYdw
/**
* @function svgMe
* @description Version with Vanilla Javascript ES5
* Converts an `<img>` tag, with a `.svg` extention and a class `svgMe`, into a `<svg>` tag.
* @return {object} Return the file svg
*/
function svgMe() {
console.info(
"%cSvgMe__javascriptES5",
"padding: 0.2rem 0.5rem; background-color: rgb(17, 176, 200); color: #fff;"
@beatrizsmerino
beatrizsmerino / verifyNum.js
Last active March 13, 2023 23:46
Verify if it is a number
function validation(num) {
if (num == "undefined" || num == null || num == "") {
console.log("Inserta un número.");
return 0;
} else {
if (isNaN(num) && num !== "") {
console.log("Ups... " + "'" + + num + "'" + " no es un número.");
return 1;
} else {
if (num % 1 == 0) {
function BrowserDetection() {
var browser;
if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode == true)) {
browser = "IE";
} else if (navigator.userAgent.indexOf("Edge") != -1) {
browser = "Edge";
} else if (navigator.userAgent.indexOf("Chrome") != -1) {
browser = "Chrome";
} else if (navigator.userAgent.indexOf("Firefox") != -1) {