Forwarded from DevTwitter | توییت برنامه نویسی
آیا میدانستید PeachPie
کد PHP را کامپایل میکنه روی .NET runtime اجرا میکنه
چه شود
https://peachpie.io
https://github.com/peachpiecompiler/peachpie
چرا یکی باید بخواد بین .net و php پل بزنه ؟
@DevTwitter | <MehrdadLinux/>
کد PHP را کامپایل میکنه روی .NET runtime اجرا میکنه
چه شود
https://peachpie.io
https://github.com/peachpiecompiler/peachpie
چرا یکی باید بخواد بین .net و php پل بزنه ؟
@DevTwitter | <MehrdadLinux/>
Forwarded from نوشتههای ترمینالی
در مورد کامند xargs و اینکه چطوری میتونه باعث افزایش سرعت کارمون بشه اینجا بخونید:
https://www.networkworld.com/article/3560213/lesser-known-xargs-command-is-a-versatile-time-saver.html
https://www.networkworld.com/article/3560213/lesser-known-xargs-command-is-a-versatile-time-saver.html
Network World
Lesser-known xargs command is a versatile time saver
Boost your Linux command line options and simplify your work with xargs, a handy tool for a number of data manipulation tasks.
Forwarded from 🎄 یک برنامه نویس تنبل ( MΞ)
🔸آلبوم جدید حضرت بهرام با حضرت سورنا:
https://soundcloud.com/peeleh/sets/khoonekhorshid
@TheRaymondDev
https://soundcloud.com/peeleh/sets/khoonekhorshid
@TheRaymondDev
SoundCloud
BAHRAM X ALI SORENA • KHOONE KHORSHID
Lyrics & Vocals: @BahramNouraei X @AliSorena
Music Producers: @AshkanMousavi, @Peymandegar
Mixing & Mastering Engineer: @AshkanMousavi
Visual Artist: Erfan Ashourioun • https://bit.ly/3Ue8cxg
Art Dire
Music Producers: @AshkanMousavi, @Peymandegar
Mixing & Mastering Engineer: @AshkanMousavi
Visual Artist: Erfan Ashourioun • https://bit.ly/3Ue8cxg
Art Dire
Forwarded from Ninja Learn | نینجا لرن
Forwarded from Code Module | کد ماژول (𔓙)
دیگه وقتت رو برای نوشتن کاستوم هوکها هدر نده🩸
پکیج usehooks-ts مجموعهای از هوکهای آماده و کاربردی برای پروژههای ریکتی هست که خوشبختانه با تایپ اسکریپت هم سازگاره. در این مجموعه، هوک های مختلفی برای انواع کارها مانند مدیریت ایونتها، مدیریت لوکال استوریج، مدیریت تایمرها، دسترسی به اطلاعات مرورگر و ... پیدا میشه، که باعث سادهتر شدن کدنویسی، سرعت بیشتر و همچنین کاهش نیاز به نوشتن کد تکراری میشه.
🔗 Link
#react
@CodeModule
پکیج usehooks-ts مجموعهای از هوکهای آماده و کاربردی برای پروژههای ریکتی هست که خوشبختانه با تایپ اسکریپت هم سازگاره. در این مجموعه، هوک های مختلفی برای انواع کارها مانند مدیریت ایونتها، مدیریت لوکال استوریج، مدیریت تایمرها، دسترسی به اطلاعات مرورگر و ... پیدا میشه، که باعث سادهتر شدن کدنویسی، سرعت بیشتر و همچنین کاهش نیاز به نوشتن کد تکراری میشه.
🔗 Link
#react
@CodeModule
usehooks-ts
React hook library, ready to use, written in Typescript.
Forwarded from ⚝ (Amir Hossein "Amiria" Maher)
Forwarded from 🎄 یک برنامه نویس تنبل (The Lazy 🌱 Raymond)
🔶 ارز تتر به تجارت نفت ورود میکند
شرکت تتر، ارائهدهندهی بزرگترین استیبلکوین جهان (USDT)، با ورود به عرصهی تجارت نفت، گامی بلند در جهت گسترش فعالیتهای خود برداشته است. بنابر بیانیه رسمی تتر، این شرکت با تأمین مالی معاملهای ۴۵ میلیون دلاری برای خرید ۶۷۰ هزار بشکه نفت خام، از تمایل خود برای ورود جدی به صنعت انرژی پردهبرداری کرد. این اقدام علاوهبر تأثیرگذاری بر بازارهای سنتی انرژی، میتواند تحولات چشمگیری را در دنیای ارزهای دیجیتال و فینتک بههمراه داشته باشد.
#خبر
@TheRaymondDev
شرکت تتر، ارائهدهندهی بزرگترین استیبلکوین جهان (USDT)، با ورود به عرصهی تجارت نفت، گامی بلند در جهت گسترش فعالیتهای خود برداشته است. بنابر بیانیه رسمی تتر، این شرکت با تأمین مالی معاملهای ۴۵ میلیون دلاری برای خرید ۶۷۰ هزار بشکه نفت خام، از تمایل خود برای ورود جدی به صنعت انرژی پردهبرداری کرد. این اقدام علاوهبر تأثیرگذاری بر بازارهای سنتی انرژی، میتواند تحولات چشمگیری را در دنیای ارزهای دیجیتال و فینتک بههمراه داشته باشد.
#خبر
@TheRaymondDev
tether.io
Tether Trade Finance Completes Funding of First Middle Eastern Crude Oil Transaction - Tether.io
8 November 2024 – Tether, the largest company in the digital asset industry today announced that its Investment division has financed a physical crude oil transaction between a publicly traded super-major oil company and a top-tier commodity trader. Completed…
Forwarded from code2 - تکنولوژی و فناوری (Mahdi Taleghani)
In a Next.js app router project, data can be fetched in multiple places depending on the nature of the data, rendering strategy, and whether the data needs to be accessed at build time, on the server, or on the client. Here’s a breakdown of where to fetch data in Next.js’s app router and when each is appropriate:
### 1. Server Components (default in
- Where: Fetch data directly within server components, like your
- When: Ideal for server-only data, sensitive data, or data that doesn’t need client-side interactivity. Server components can fetch data using async functions and make use of server-only packages (e.g., databases).
- Example:
- Considerations: Server components do not increase the JavaScript sent to the client. However, since they are server-rendered, you may need additional client-side components if you want interactivity.
### 2. Client Components (use
- Where: If you need client-side interactivity, mark the component with
- When: Useful for data that requires client-side interactivity, like managing local state, dynamic data fetching (especially based on user interactions), or when using APIs that are only available on the client.
- Example:
- Considerations: Client components increase the JavaScript bundle size sent to the client, so they should be used when necessary.
### 3. API Routes
- Where: Use
- When: Use API routes when you want to keep logic (like authentication, session checks, or data manipulation) separate from the component. This is especially useful for POST requests, sensitive data handling, or operations that don’t need to be part of the server-rendering flow.
- Example:
- Considerations: API routes offer more flexibility and can be used by both server and client components, which is useful for actions like form submissions or fetching data on demand.
### 1. Server Components (default in
app directory)- Where: Fetch data directly within server components, like your
page.tsx or other components under the app directory.- When: Ideal for server-only data, sensitive data, or data that doesn’t need client-side interactivity. Server components can fetch data using async functions and make use of server-only packages (e.g., databases).
- Example:
import { PrismaClient } from "@prisma/client";
export default async function Page() {
const prisma = new PrismaClient();
const data = await prisma.someModel.findMany();
return (
<div>
{/* Render data */}
</div>
);
}
- Considerations: Server components do not increase the JavaScript sent to the client. However, since they are server-rendered, you may need additional client-side components if you want interactivity.
### 2. Client Components (use
use client directive)- Where: If you need client-side interactivity, mark the component with
use client at the top and use data-fetching hooks like useEffect.- When: Useful for data that requires client-side interactivity, like managing local state, dynamic data fetching (especially based on user interactions), or when using APIs that are only available on the client.
- Example:
"use client";
import { useState, useEffect } from 'react';
export default function ClientComponent() {
const [data, setData] = useState(null);
useEffect(() => {
async function fetchData() {
const response = await fetch('/api/data');
const result = await response.json();
setData(result);
}
fetchData();
}, []);
return <div>{data ? JSON.stringify(data) : 'Loading...'}</div>;
}
- Considerations: Client components increase the JavaScript bundle size sent to the client, so they should be used when necessary.
### 3. API Routes
- Where: Use
pages/api to create backend API endpoints, which can be called from both server and client components.- When: Use API routes when you want to keep logic (like authentication, session checks, or data manipulation) separate from the component. This is especially useful for POST requests, sensitive data handling, or operations that don’t need to be part of the server-rendering flow.
- Example:
// pages/api/data.ts
import { NextApiRequest, NextApiResponse } from 'next';
import { PrismaClient } from '@prisma/client';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const prisma = new PrismaClient();
const data = await prisma.someModel.findMany();
res.status(200).json(data);
}
- Considerations: API routes offer more flexibility and can be used by both server and client components, which is useful for actions like form submissions or fetching data on demand.
Forwarded from code2 - تکنولوژی و فناوری (Mahdi Taleghani)
### 4. Middleware (for authentication and access control)
- Where: Use a
- When: Middleware is useful for route-based logic, like authentication or role-based access control, without directly fetching data for rendering. Middleware runs on the edge and can redirect users based on conditions.
- Example:
- Considerations: Middleware is limited in functionality compared to traditional API routes but is highly efficient for edge-based logic.
### 5. Static Fetching (using
- Where: If the data doesn’t change often and you don’t need real-time updates, use static generation with
- When: For data that doesn’t change frequently (e.g., blog posts, product pages) or when optimizing for SEO by generating pages at build time.
- Example:
### Summary
- Use Server Components by default for data fetching when rendering on the server.
- Use Client Components for client-side interactions or dynamic data that changes after initial render.
- Use API Routes for encapsulating backend logic or for requests initiated on the client-side.
- Use Middleware for lightweight route protection or conditionally redirecting users.
- Use Static Fetching for rarely changing content that benefits from static generation (like blog posts).
Each strategy is flexible, and you can mix these approaches depending on the needs of each part of your app.
- Where: Use a
middleware.ts file in the root directory.- When: Middleware is useful for route-based logic, like authentication or role-based access control, without directly fetching data for rendering. Middleware runs on the edge and can redirect users based on conditions.
- Example:
// middleware.ts
import { NextResponse } from 'next/server';
export async function middleware(request) {
const isAuthenticated = checkAuth(request); // Define your own check
if (!isAuthenticated) return NextResponse.redirect(new URL('/login', request.url));
return NextResponse.next();
}
export const config = {
matcher: '/protected/:path*', // Apply to specific routes
};
- Considerations: Middleware is limited in functionality compared to traditional API routes but is highly efficient for edge-based logic.
### 5. Static Fetching (using
generateStaticParams for Static Site Generation)- Where: If the data doesn’t change often and you don’t need real-time updates, use static generation with
generateStaticParams or getStaticProps in the app directory.- When: For data that doesn’t change frequently (e.g., blog posts, product pages) or when optimizing for SEO by generating pages at build time.
- Example:
import { PrismaClient } from '@prisma/client';
export async function generateStaticParams() {
const prisma = new PrismaClient();
const items = await prisma.someModel.findMany();
return items.map(item => ({ id: item.id }));
}
### Summary
- Use Server Components by default for data fetching when rendering on the server.
- Use Client Components for client-side interactions or dynamic data that changes after initial render.
- Use API Routes for encapsulating backend logic or for requests initiated on the client-side.
- Use Middleware for lightweight route protection or conditionally redirecting users.
- Use Static Fetching for rarely changing content that benefits from static generation (like blog posts).
Each strategy is flexible, and you can mix these approaches depending on the needs of each part of your app.
Forwarded from 🎄 یک برنامه نویس تنبل (The Lazy 🌱 Raymond)
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from 🎄 یک برنامه نویس تنبل (The Lazy 🌱 Raymond)
Forwarded from 🎄 یک برنامه نویس تنبل (The Lazy 🌱 Raymond)
🔶 از فردا برای قطعی برق آماده باشید.
سعی کنید دستگاه هایی با آن کار نمی کنید از پریز برف بیرون بکشید که با قطعی برق دچار خرابی نشود.
موقعی که برق دارید, پاوربانک و گوشی کامل شارژ کنید.
@TheRaymondDev
سعی کنید دستگاه هایی با آن کار نمی کنید از پریز برف بیرون بکشید که با قطعی برق دچار خرابی نشود.
موقعی که برق دارید, پاوربانک و گوشی کامل شارژ کنید.
@TheRaymondDev
Forwarded from LearnPOV | لرن پی او وی (Mohammad hossein)
Forwarded from WINaTALENT | International Freelancing Platform
‼️مسیری هموار برای کار بینالمللی و مهاجرت شغلی
از طریق WINaTALENT
✅ امکان اپلای برای بیش از ۳۲۰ پوزیشن در بیش از ۲۰ کشور اروپایی
✅ داشتن ریفرر اختصاصی
✅۶۰٪ شانس بیشتر برای تایید اپلای
با سرویس Refriend میتونی برای شغلهایی با ویزا اسپانسرشیپ اپلای کنی.
با کد تخفیف، ثبتنام کن و مسیر مهاجرت شغلیت رو شروع کن.
تعداد محدود
👤💼 کد تخفیف، در کانال WINaTALENT!
@winatalent_fa
@winatalent_fa
@winatalent_fa
از طریق WINaTALENT
✅ امکان اپلای برای بیش از ۳۲۰ پوزیشن در بیش از ۲۰ کشور اروپایی
✅ داشتن ریفرر اختصاصی
✅۶۰٪ شانس بیشتر برای تایید اپلای
با سرویس Refriend میتونی برای شغلهایی با ویزا اسپانسرشیپ اپلای کنی.
با کد تخفیف، ثبتنام کن و مسیر مهاجرت شغلیت رو شروع کن.
👤💼 کد تخفیف، در کانال WINaTALENT!
@winatalent_fa
@winatalent_fa
@winatalent_fa
Forwarded from Gopher Academy
🥂امروز 10 november هست روزی که گولنگ به دنیا اومد🎂
🍻زادروزت خجسته باد
❤️Go
🔹High-level programming language
🫡Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but also has memory safety, garbage collection, structural typing, and CSP-style concurrency. Wikipedia
🔻Designed by: Robert Griesemer, Rob Pike, Ken Thompson
🔻First appeared: November 10, 2009; 14 years ago
🔻Implementation language: Go, Assembly language (gc); C++ (gofrontend)
🔻License: 3-clause BSD + patent grant
🔻Memory management: Garbage collection
🔻OS: DragonFly BSD, FreeBSD, Linux, macOS, NetBSD, OpenBSD, Plan 9, Solaris, Windows
🔻Paradigm: Multi-paradigm: concurrent imperative, functional object-oriented
➖➖➖➖➖➖➖➖
👑 @gopher_academy
🍻زادروزت خجسته باد
❤️Go
🔹High-level programming language
🫡Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but also has memory safety, garbage collection, structural typing, and CSP-style concurrency. Wikipedia
🔻Designed by: Robert Griesemer, Rob Pike, Ken Thompson
🔻First appeared: November 10, 2009; 14 years ago
🔻Implementation language: Go, Assembly language (gc); C++ (gofrontend)
🔻License: 3-clause BSD + patent grant
🔻Memory management: Garbage collection
🔻OS: DragonFly BSD, FreeBSD, Linux, macOS, NetBSD, OpenBSD, Plan 9, Solaris, Windows
🔻Paradigm: Multi-paradigm: concurrent imperative, functional object-oriented
➖➖➖➖➖➖➖➖
👑 @gopher_academy