DeveloperBreeze

Find the code you need

Search through tutorials, code snippets, and development resources

Tutorial

ما هو حقن التبعيات (Dependency Injection)؟

بهذه الطريقة، يصبح كل كائن أقل اعتماداً على التفاصيل الداخلية، وأكثر مرونة وقابلاً للاختبار.

عندما تعتمد الكائنات على إنشاء التبعيات داخلياً، فإن النظام يصبح مترابطاً بشكل كبير. حقن التبعيات يفصل عملية الإنشاء عن الاستخدام، مما يقلل الترابط ويجعل البنية أكثر تنظيماً.

Dec 01, 2025
Read More
Tutorial

How to Stop SSH From Timing Out

If your SSH session closes after a minute of inactivity, it’s usually caused by idle timeouts. You can fix this with keep-alive settings on both the server and client.

Edit the SSH daemon config:

Aug 21, 2025
Read More
Tutorial

How to Translate URLs in React (2025 Guide)

Create pages/Home.js:

import { useTranslation } from 'react-i18next';

export default function Home() {
  const { t } = useTranslation();
  return (
    <div>
      <h1>{t('title')}</h1>
    </div>
  );
}

May 04, 2025
Read More
Tutorial

Globalization in React (2025 Trends & Best Practices)

  • GDPR requires local-language privacy policies
  • China's Cybersecurity Law needs local hosting + Mandarin support
  • Saudi localization laws mandate Arabic for all government services

Your React app must support legal localization where applicable.

May 04, 2025
Read More
Tutorial

Implementing Internationalization (i18n) in a Large React Application (2025 Guide)

npm install i18next react-i18next i18next-browser-languagedetector

Create a new file: src/i18n.js

May 04, 2025
Read More
Tutorial

Building Micro-Frontends with Webpack Module Federation (2025 Guide)

npm install -D webpack webpack-cli webpack-dev-server html-webpack-plugin

Create a webpack.config.js:

May 04, 2025
Read More
Tutorial

State Management Beyond Redux: Using Zustand for Scalable React Apps

import create from 'zustand';
import { persist } from 'zustand/middleware';

const useStore = create(persist(
  (set) => ({
    count: 0,
    increase: () => set((state) => ({ count: state.count + 1 })),
  }),
  {
    name: 'counter-storage',
  }
));

Zustand allows you to select specific parts of the state to prevent unnecessary re-renders:

May 03, 2025
Read More
Tutorial

Mastering React Rendering Performance with Memoization and Context

   const increment = useCallback(() => setCount(c => c + 1), []);

Implementing these practices ensures that only components dependent on specific context values re-render when those values change.([Medium][7])

May 03, 2025
Read More
Tutorial

How to Disable MySQL Password Validation on Ubuntu 25.04

If you want to bring back strong password policies:

INSTALL COMPONENT 'file://component_validate_password';

May 01, 2025
Read More
Tutorial

How to Move the MySQL Data Directory to a New Location on Ubuntu 25.04

Ensure MySQL can access the new directory:

sudo chown -R mysql:mysql /mnt/data/mysql

May 01, 2025
Read More
Tutorial

How to Fix NVIDIA Driver Issues on Ubuntu (Dell Vostro 3521)

If your NVIDIA GPU isn’t detected properly on Ubuntu, or nvidia-smi shows an error like "couldn't communicate with the NVIDIA driver", this guide will walk you through how to fix that.

This was tested and confirmed working on a Dell Vostro 3521 with an NVIDIA GeForce MX350 GPU.

Apr 14, 2025
Read More
Tutorial

Avoiding Memory Leaks in C++ Without Smart Pointers

C++ developers often face memory management headaches, especially when working on legacy systems that don’t use C++11 or newer. Smart pointers like std::unique_ptr and std::shared_ptr are powerful, but what if you’re stuck with raw pointers?

In this tutorial, you'll learn:

Apr 11, 2025
Read More
Tutorial

Deep Copy in C++: How to Avoid Shallow Copy Pitfalls

class String {
private:
    char* buffer;

public:
    String(const char* str) {
        buffer = new char[strlen(str) + 1];
        strcpy(buffer, str);
    }

    // Copy constructor
    String(const String& other) {
        buffer = new char[strlen(other.buffer) + 1];
        strcpy(buffer, other.buffer);
    }

    // Assignment operator
    String& operator=(const String& other) {
        if (this != &other) {
            delete[] buffer;
            buffer = new char[strlen(other.buffer) + 1];
            strcpy(buffer, other.buffer);
        }
        return *this;
    }

    ~String() {
        delete[] buffer;
    }

    void print() const {
        std::cout << buffer << std::endl;
    }
};
String a("Hello");
String b = a;       // deep copy
String c("World");
c = a;              // deep assignment

Apr 11, 2025
Read More
Tutorial

Protect Your Forms Like a Pro: Anti-Spam Techniques That Actually Work

A honeypot is a hidden form field that users don’t see, but bots do. If the field is filled, you know it’s a bot.

<input type="text" name="phone_number" style="display:none" autocomplete="off">

Apr 04, 2025
Read More
Tutorial

Build a Custom Rate Limiter in Node.js with Redis

curl http://localhost:3000

After 100 requests within an hour, you’ll get:

Apr 04, 2025
Read More
Tutorial

Arduino Basics: A Step-by-Step Tutorial

Table 2: Digital vs. Analog signals in Arduino projects.

One of the simplest and most popular starter projects is blinking an LED. Follow these steps:

Feb 12, 2025
Read More
Tutorial
javascript

Building a Real-Time Object Detection Web App with TensorFlow.js and p5.js

This HTML file loads p5.js, TensorFlow.js, and the COCO-SSD model library. We also reference our custom script file (sketch.js), which will contain our application logic.

Create a new file called sketch.js in your project folder. We’ll use p5.js to access the webcam and display the video on a canvas:

Feb 12, 2025
Read More
Tutorial

Building a Cross-Platform Desktop App with Tauri and Svelte: A Step-by-Step Tutorial

Tauri leverages web technologies to build native desktop applications while offloading critical operations to Rust. Paired with Svelte—a fast, compile-time JavaScript framework—you can create modern apps that are both visually appealing and highly performant. This tutorial will walk you through setting up your development environment, creating a Svelte project, integrating Tauri, and building your first desktop app.

Before diving in, ensure you have the following installed:

Feb 12, 2025
Read More
Tutorial

Implementing a Domain-Specific Language (DSL) with LLVM and C++

#ifndef DSL_LEXER_H
#define DSL_LEXER_H

#include <string>
#include <vector>

enum class TokenType {
    Number,
    Plus,
    Minus,
    Asterisk,
    Slash,
    LParen,
    RParen,
    EndOfFile,
    Invalid
};

struct Token {
    TokenType type;
    std::string text;
    double value; // Only valid for Number tokens.
};

class Lexer {
public:
    Lexer(const std::string& input);
    Token getNextToken();

private:
    const std::string input;
    size_t pos = 0;
    char currentChar();

    void advance();
    void skipWhitespace();
    Token number();
};

#endif // DSL_LEXER_H

Implementation: Lexer.cpp

Feb 12, 2025
Read More