Find the code you need
Search through tutorials, code snippets, and development resources
ما هو حقن التبعيات (Dependency Injection)؟
$this->app->bind(UserRepository::class, EloquentUserRepository::class);وبمجرد التسجيل، يقوم Laravel تلقائياً بحقن التبعية عند الحاجة.
How to Stop SSH From Timing Out
Edit the SSH daemon config:
sudo nano /etc/ssh/sshd_configHow to Translate URLs in React (2025 Guide)
- Dynamically switch between translated URLs
- Support SEO-friendly, localized routing
- Scale to additional languages easily
- Add 404 fallbacks for non-matching paths
- Integrate
i18next-http-backendto load translations from a CMS - Use language subdomains (e.g.,
fr.site.com) for region-specific experiences
Globalization in React (2025 Trends & Best Practices)
- Color psychology changes per region
Red = luck in China, danger in the West.
Implementing Internationalization (i18n) in a Large React Application (2025 Guide)
As businesses go global, your frontend must cater to users from different regions, languages, and cultures. A well-implemented internationalization (i18n) strategy in your React app ensures:
- Seamless language switching
- Proper formatting of dates, numbers, and currencies
- Better accessibility and user retention
- Improved SEO in multilingual search queries
Building Micro-Frontends with Webpack Module Federation (2025 Guide)
We’ll build two apps:
/app-shell (React)
webpack.config.js
src/
bootstrap.js
/analytics-app (Vue)
webpack.config.js
src/
main.jsState Management Beyond Redux: Using Zustand for Scalable React Apps
While both Zustand and Redux serve the purpose of state management in React applications, they differ significantly in their approach and complexity.
Zustand's simplicity and performance make it a compelling choice for projects where Redux might be overkill.
Mastering React Rendering Performance with Memoization and Context
import React, { useState, useMemo } from 'react';
function ExpensiveComponent({ data }) {
const processedData = useMemo(() => {
// Expensive computation
return data.map(item => /* processing */ item);
}, [data]);
return <div>{/* render processedData */}</div>;
}This approach ensures that the expensive computation runs only when data changes, improving performance.
How to Disable MySQL Password Validation on Ubuntu 25.04
MySQL 8+ includes a password validation plugin (validate_password) that enforces strong password rules by default. If you're working in a local development environment and want to disable this feature to allow simpler passwords (e.g., password, 123456), follow this safe step-by-step tutorial.
sudo mysqlHow to Move the MySQL Data Directory to a New Location on Ubuntu 25.04
sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqldIf needed, recreate the MySQL socket directory:
How to Install PHP, MySQL, and phpMyAdmin on Ubuntu 25.04 (LAMP Stack Setup Guide)
During installation:
- When prompted to choose a web server, select apache2.
- Choose Yes when asked to configure the database for phpMyAdmin with dbconfig-common.
- Set a password for the phpMyAdmin application.
How to Fix NVIDIA Driver Issues on Ubuntu (Dell Vostro 3521)
Install Mesa utilities:
sudo apt install mesa-utils
glxinfo | grep "OpenGL renderer"Avoiding Memory Leaks in C++ Without Smart Pointers
Consider this code:
void loadData() {
char* buffer = new char[1024];
// some processing...
if (someCondition()) {
return; // leak!
}
delete[] buffer;
}Deep Copy in C++: How to Avoid Shallow Copy Pitfalls
This tutorial covers:
- What shallow vs deep copy means
- The problems caused by shallow copy
- How to implement deep copy correctly
- A practical class example with dynamic memory
- When to use
Rule of ThreevsRule of Five
Protect Your Forms Like a Pro: Anti-Spam Techniques That Actually Work
You can also use middleware like:
express-rate-limit(Node.js)- Laravel's built-in throttling
Build a Custom Rate Limiter in Node.js with Redis
Create a .env file:
REDIS_URL=redis://localhost:6379Arduino Basics: A Step-by-Step Tutorial
Key features include:
- Open-source hardware and software
- User-friendly programming environment
- A large community with plenty of tutorials and libraries
Building a Real-Time Object Detection Web App with TensorFlow.js and p5.js
- Setup: The
setupfunction initializes the canvas and video capture. The video is hidden by p5.js’s default element so that we can draw it onto the canvas manually. - Model Loading: We load the COCO-SSD model asynchronously. Once the model is ready, we start continuous object detection by calling
detectObjects(). - Detection Loop: The
detectObjectsfunction uses the loaded model to analyze the current video frame and stores the detection results. It recursively calls itself so that new frames are analyzed continuously. - Drawing: In the
drawloop, the video feed is displayed and for each detected object, a rectangle and label are drawn. The bounding box coordinates and object class are provided by the model.
Now that you have a basic real-time object detection app, consider extending its functionality:
Building a Cross-Platform Desktop App with Tauri and Svelte: A Step-by-Step Tutorial
Customize these options to fit your project’s needs.
Edit your Svelte components in the src folder. Open src/App.svelte and modify it to add your custom UI. For example:
Implementing a Domain-Specific Language (DSL) with LLVM and C++
Modern applications demand flexible, domain-focused solutions. A DSL allows domain experts to express complex logic concisely and can be optimized for performance. Leveraging LLVM gives you access to state-of-the-art optimization and code generation tools, so you can create languages that compile to highly efficient native code. In this tutorial, we’ll implement a simple mathematical expression language (with potential for future extensions) that computes results in real time.
Tools & Libraries: