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
sudo systemctl restart sshdOn your local machine, edit or create:
How to Translate URLs in React (2025 Guide)
Create i18n.js:
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import en from './locales/en.json';
import fr from './locales/fr.json';
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: { en: { translation: en }, fr: { translation: fr } },
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
});
export default i18n;Globalization in React (2025 Trends & Best Practices)
React example:
const today = new Intl.DateTimeFormat(i18n.language).format(new Date());Implementing Internationalization (i18n) in a Large React Application (2025 Guide)
/src
/locales
en.json
fr.jsonExample en.json:
Building Micro-Frontends with Webpack Module Federation (2025 Guide)
Each micro-frontend should be versioned and deployed separately.
Use shared in Module Federation to prevent loading duplicate libraries (like react, vue, etc.).
State Management Beyond Redux: Using Zustand for Scalable React Apps
const count = useStore((state) => state.count);By selecting only the necessary state slices, you can optimize component rendering and improve performance.
Mastering React Rendering Performance with Memoization and Context
const value = useMemo(() => ({ user, setUser }), [user]); const increment = useCallback(() => setCount(c => c + 1), []);How to Disable MySQL Password Validation on Ubuntu 25.04
Now that validation is disabled, try creating a user with a weak password:
CREATE USER 'devuser'@'localhost' IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON *.* TO 'devuser'@'localhost';
FLUSH PRIVILEGES;How to Move the MySQL Data Directory to a New Location on Ubuntu 25.04
Find the line:
datadir = /var/lib/mysqlHow 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)
Launch apps like this:
prime-run firefox
prime-run blender
prime-run vlcAvoiding Memory Leaks in C++ Without Smart Pointers
Let’s build a small ScopedPointer class.
template <typename T>
class ScopedPointer {
private:
T* ptr;
public:
explicit ScopedPointer(T* p = nullptr) : ptr(p) {}
~ScopedPointer() {
delete ptr;
}
T& operator*() const { return *ptr; }
T* operator->() const { return ptr; }
T* get() const { return ptr; }
void reset(T* p = nullptr) {
if (ptr != p) {
delete ptr;
ptr = p;
}
}
// Prevent copy
ScopedPointer(const ScopedPointer&) = delete;
ScopedPointer& operator=(const ScopedPointer&) = delete;
};Deep Copy in C++: How to Avoid Shallow Copy Pitfalls
- Copy Constructor
- Copy Assignment Operator
- Destructor
You must implement all three. This is called the Rule of Three.
Protect Your Forms Like a Pro: Anti-Spam Techniques That Actually Work
<input type="hidden" name="fake_field" style="display: none">
<input type="hidden" name="start_time" value="{{ now() }}">If you’re serious about user experience and stopping spam, avoid relying on just one method. Bots are getting smarter, but stacking simple techniques gives you a major edge.
Build a Custom Rate Limiter in Node.js with Redis
const userKey = req.headers['x-api-key'] || req.ip;
const key = `rate_limit:${userKey}`;You can now:
Arduino Basics: A Step-by-Step Tutorial
Here’s a simplified table of the Arduino Uno’s pin configuration:
Table 3: Key pin configurations on the Arduino Uno.
Building a Real-Time Object Detection Web App with TensorFlow.js and p5.js
- A modern web browser that supports webcam access (Chrome, Firefox, or Edge).
- Basic knowledge of HTML, CSS, and JavaScript.
- Familiarity with p5.js (optional, but helpful).
- A code editor (Visual Studio Code, Sublime Text, etc.).
You do not need any backend setup since everything runs in the browser using TensorFlow.js and p5.js.
Building a Cross-Platform Desktop App with Tauri and Svelte: A Step-by-Step Tutorial
npx degit sveltejs/template tauri-svelte-app
cd tauri-svelte-app
npm installThis command creates a fresh Svelte application in the tauri-svelte-app directory and installs all required dependencies.
Implementing a Domain-Specific Language (DSL) with LLVM and C++
The lexer (or tokenizer) converts a stream of characters into a sequence of tokens. Each token represents a logical unit, such as a number or operator.
Header: Lexer.h