ServicesRapid Web DevelopmentAudits & ModernizationAI StrategyDigital Growth & SEO
MenuThe LabProductsInsightsProfile
Contact
Engineering Blueprints

The Lab - Free Programming Examples, Patterns & Real Code

This is a curated collection of programming examples, architectural patterns, and reusable code snippets I’ve built while exploring new technologies and refining existing ones.

The Lab – Free Programming Examples, Patterns & Real Code

Filter by Domain:

All Topics
Enterprise PHP
AI & Python Engineering
Data Architecture & SQL
Interface Engineering
Node.js & Real-time Systems
DevOps & Infrastructure
Experimental / Blueprints
Node.js

Node.js example - how to change the file extensions of all files in a folder

A simple Node.js example showing to change all images extension from .jpeg to .jpg...

Programming Example
Read More →
HTACCESS

How to redirect http to https or fix the not secure warning in the browser

In this example we consider the rewrite rules for Apache and Nginx to redirect a website from http to https...

Programming Example
Read More →
HTACCESS

How to redirect an old site to a new domain with rewrite rules

In this example we show how to redirect all the pages from an old website and domain to a new one or redirect only some selected pages or how to redirect only the main website page...

Programming Example
Read More →
CSS

How to animate an image with pure CSS?

A simple example of rotating infinitely an image with pure CSS...

Programming Example
Read More →
HTML

How to add a MP3 file to a web page and play music when user is loading it

In this example we show how can you embed and play a mp3 file on a web page...

Programming Example
Read More →
HTML

How to embed an MP4 video on a web page using the video HTML tag

In this brief tutorial, we consider a basix example of adding an MP4 video to a web page...

Programming Example
Read More →
XML

Example of searching XML file with PHP and XPath

A basic example of searching XML file using PHP XPath queries...

Programming Example
Read More →

An example of a JavaScript function to print the content of a div

An useful example of creating a simple JavaScript function to print the content of a selected DIV on a page...

Programming Example
Read More →

Sanitizing the user input with the PHP filter_var function

Nowadays validating the user input in web applications is really important and in this article we review the filter_var function that can be very useful when programming in PHP...

Programming Example
Read More →
PHP

Example of a PHP function to resize an image

Check an example of how you can resize an image with PHP...

Programming Example
Read More →
PHP

PHP function to convert a jpg image to webp

Speed up your website loading and improve SEO by converting your jpg images to webp...

Programming Example
Read More →
MySQL

Speed up the files import and INSERT statements in MySQL

Find out how you can import faster files in MySQL tables by disabling the keys before the import and re-enabling them again after...

Programming Example
Read More →
async_db_connector.py
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine

# Optimized connection pool for high-concurrency
class DatabaseManager:
    def __init__(self, db_url: str):
        self.engine = create_async_engine(
            db_url,
            pool_size=20,
            max_overflow=10,
            pool_pre_ping=True
        )

    async def get_session(self):
        """Yields a highly available session."""
        async with self.engine.begin() as conn:
            yield conn
            
    # ... security middleware logic below
Featured Snippet

Clean Code Standards

I believe code should be self-documenting. Whether it's Python, PHP, or JavaScript, I adhere to strict standards (PSR-12, PEP 8) to ensure that the systems I build are maintainable by your team long after I leave.

  • ✓ Type Hinting & Static Analysis
  • ✓ Comprehensive Error Handling
  • ✓ Modular, Testable Components
View GitHub Profile