Skip to content

Instantly share code, notes, and snippets.

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

Teddy Paz Muñoz pazteddy

🏠
Working from home
View GitHub Profile
@pazteddy
pazteddy / ArrayFunctions.php
Last active January 26, 2026 16:12
Instrucciones de tarea, listado de Catálogo y usuarios
$catalog = [
["sku" => "LP-001", "name" => "Laptop", "price" => 1200, "stock" => 3],
["sku" => "MS-002", "name" => "Mouse", "price" => 25, "stock" => 0],
["sku" => "KB-003", "name" => "Teclado", "price" => 80, "stock" => 12],
];
$usersTask = [
["id" => 1, "name" => "Ana", "email" => "ana@email.com", "role" => "user"],
["id" => 2, "name" => "Luis", "email" => "luis@email.com", "role" => "admin"],
["id" => 3, "name" => "María", "email" => "maria@email.com", "role" => "editor"],
@pazteddy
pazteddy / ArrayFunctions.php
Created January 22, 2026 17:33
Carro de compras
<?php
$cart = [
["product" => "Laptop", "price" => 1200],
["product" => "Mouse", "price" => 20],
["product" => "Teclado", "price" => 80]
];
@pazteddy
pazteddy / ArrayFunctions.php
Created January 22, 2026 16:18
Lista de usuarios
<?php
$users = [
[
"id" => 1,
"name" => "Ana García",
"username" => "ana.garcia",
"email" => "ana.garcia@example.com",
"role" => "user",
"status" => "active",
"last_login" => "2026-01-20 09:15"
@pazteddy
pazteddy / BreakContinue.md
Created January 20, 2026 16:22
Diferencias, usos típicos de break y continue

⚖️ Diferencia clara entre break y continue

Instrucción Qué hace
break Sale del bucle por completo
continue Salta la iteración actual
Uso típico Buscar algo y detener
Uso típico Filtrar o ignorar datos

❌ Errores comunes

@pazteddy
pazteddy / condicionales.md
Last active January 20, 2026 17:20
Condicionales en PHP

Situaciones recomendadas para el uso de condicionales:

Situación Recomendado
Comparaciones complejas if / else
Rangos de valores if / elseif
Comparar un solo valor fijo switch o match
Condiciones con operadores lógicos if

❌ Errores comunes (evítalos)

@pazteddy
pazteddy / Operators.php
Last active January 19, 2026 18:21
Operadores en PHP
<?php
declare(strict_types=1);
echo "🛒 Operadores en PHP\n\n";
$price = 120.50;
$qty = 3;
$stock = 2;
$coupon = "DEV10";
@pazteddy
pazteddy / Instalaciones-php-empieza.md
Last active January 14, 2026 20:16
Instalaciones recomendadas - PHP moderno: Empieza tu camino en el lenguaje
@pazteddy
pazteddy / OrderIntegrationTests.cs
Last active December 15, 2025 13:32
Pruebas de integración para listado y cálculos de Orders
public class OrderIntegrationTests : IAsyncLifetime
{
private CustomWebApplicationFactory _factory = null!;
private HttpClient _httpClient = null!;
public async Task InitializeAsync()
{
_factory = new CustomWebApplicationFactory();
_httpClient = _factory.GetHttpClient();
await Task.CompletedTask;
@pazteddy
pazteddy / ProductIntegrationTests.cs
Created December 13, 2025 15:46
Pruebas de Integración de Products con WebApplicationFactory
namespace DevTallesShop.Api.Tests.Integration;
public class ProductIntegrationTests : IAsyncLifetime
{
private CustomWebApplicationFactory _factory = null!;
private HttpClient _httpClient = null!;
public async Task InitializeAsync()
{
_factory = new CustomWebApplicationFactory();
_httpClient = _factory.GetHttpClient();
@pazteddy
pazteddy / CustomerIntegrationTests.cs
Last active December 13, 2025 15:43
Pruebas de integración para Customers con WebApplicationFactory
public class CustomerIntegrationTests : IAsyncLifetime
{
private CustomWebApplicationFactory _factory = null!;
private HttpClient _httpClient = null!;
public async Task InitializeAsync()
{
_factory = new CustomWebApplicationFactory();
_httpClient = _factory.GetHttpClient();
await Task.CompletedTask;