Web Devs
639 subscribers
218 photos
22 videos
17 files
233 links
Articles, News, Jokes, Quotes, Back-End and UI/UX for web developers.
Github : https://github.com/fullStackDevsGroup
Advertising: @adsfullStackDevs
Download Telegram
Forwarded from Web Devs
#LoopOptimizations

Loop Optimizations in C# (and various other compilers)


This post comprises infographics showing various loop optimizations that happen in C# (dotnet).

🔗 Link

@fullStackDevs
#VSCode
#Github

A cool feature that GitHub has just added is the use of a point (.) key .wherever you are in the repository, which opens the code on the VS Code Editor browser

یک ویژگی جالب که GitHub به تازگی اضافه کرده است ، استفاده از کلید نقطه در هر کجا که در مخزن هستید ، است که کد را روی یک VS Code Editor browser باز می کند.
فقط برا ما گویا با وی پی ان باز میکنه 😐

@fullStackDevs
Forwarded from Web Devs
#javaScript_tricks
#js

❇️ در این پست چندتا تکنیک جاوا اسکریپتی معرفی میکنیم که امیداوریم براتون مفید واقع بشه.

🔹لاگ سریع در console به کمک object literal میتونید متغیرهاتون رو خیلی سریع و خوانا لاگ بزنید.
const myVar = 'foo'
const otherVar = 2

// output:
// {myVar: "foo", otherVar: 2}
console.log({ myVar, otherVar })

به
این ترتیب یه آبجکت میسازین و مقدار هر پراپرتیش به همراه نامش در کنسول لاگ میشه.

🔹نمایش نام پارامترهای تابع به همراه تایپ شون.
به کمک object destructuring در جاوا اسکریپت و مشخص کردن مقدار پیشفرض برای پارامتر های تابع میتونید موقع صدا زدن تابع نام پارامتر ها به همراه تایپ اونها رو داشته باشید و از آنجایی که به پارامترتون مقدار پیشفرض دادید به صورت optional هست و به شکل های متفاوت میتونید تابع تون رو صدا بزنید.

const notify = (msg, { type = 'info', timeout, close = true } = {}) => {
// display notification
}

notify('Hi!')
notify('Hi!', { type: 'error' })
notify('Hi!', { type: 'warn', close: false })

🔹کلون کردن آرایه.
از اونجایی که ارایه ها با رفرنسشون پاس داده میشن به کمک spread operator میتونید یک آرایه رو به راحتی کلون کنید.
const manipulateList = (list) => {
// defensively copy list
const copiedList = [
...list]

// do something with copiedList
}

🔹 اجباری کردن پارامترهای تابع
به کمک مقدار دهی پیشفرض برای پارامترهای تابع و به کمک این تکنیک میتونید پارامترهای توابع تون رو درصورتی که مقداری براشون پاس داده نشده اجباری کنید.
const throwIfMissing = () => {
throw new Error('Missing parameter')
}
const func = (requiredParam = throwIfMissing()) => {
// some implementation
}


🔹رکوئست های زماندار (برای fetch api)
دیگر لایبری های رایج جاوااسکریپتی مثل jquery ajax و axios این امکان رو بهتون میدن تا برای درخواستتون یک timeout تنظیم کنین و درصورتی که در زمان مشخص شده رکوئست انجام نشد، خودکار fail بشه.
متد fetch در مرورگر های جدید به صورت توکار چنین قابلیتی رو نداره اما به کمک این تکنیک میتونید اینکار رو انجام بدید.

const timeout = (delay = 30000) => {
return new Promise((resolve, reject) => {
const rejectWithError = () => {
reject(new Error('Timed out!'))
}

setTimeout(
rejectWithError, delay)
})
}

const fetchWithTimeout = (url, delay = 3000) => {
// construct an array to pass to `Promise.race`
return Promise.race([fetch(url),
timeout(delay)])
}

fetchWithTimeout('/json/data.json', 1000)
.then((response) => {
// successful response before the 1 s timeout
console.log('successful response', response)
})
.catch((e) => {
// Either the timeout occurred or some other error.
// Would need to check the method or use a custom
// Error subclass in timeout
console.error('request error', e)
})

🔹تبدیل رشته به عدد .
برای تبدیل رشته های عددی به معادل number ای شون از این تکنیک استفاده کنید.
let int = "15";

int =
+int;

اگر جایی امکان استفاده از عملگر + نداشتید از دوتا عملگر ~~ استفاده کنید.

@fullStackDevs
#Resful
#Rest


RESTFUL is not architecture

Rest is an architecture and restful is a service that implements this architecture.

🔅 There are 4 attribute for RestfulApi

1.client-server
Backend is server and frontend is client
and these are independent and scalable.

2. stateless
No data is stored on the server side and the server is never aware of the previous status of the client and does not face changes in the client server.

3.cacheable
Ability to cache response on the client side.

4.uniform interface
we can see method from url and Response hase satatus code for show detail to client.

✍️ fathollahi

@fullStackDevs
Forwarded from Web Devs
This media is not supported in your browser
VIEW IN TELEGRAM
Insights and productivity

The AI IntelliCode engine in Visual Studio continues to get better at seamlessly anticipating your next move. Visual Studio 2022 will provide more and deeper integrations into your daily workflows, helping you to take the right action in the right place at the right time.


📌 Link

@fullStackDevs
#js
#ECMAScript

javascript - ECMAScript


@fullStackDevs
Happy Programmers' Day

The Day of the Programmer is an international professional day that is celebrated on the 256th day of each year. The number 256 was chosen because it is the number of distinct values that can be represented with a byte, a value well known to programmers.

@fullStackDevs
👍1
👍1
Forwarded from Web Devs
#جاوا_اسکریپت


با استفاده از متد console.table
می‌تونید آرایه‌ای آبجکت ها رو در کنسول به جدول تبدیل کنید.

@fullStackDevs
👍1
#Js
#javascript
#Trick

Object.keys, values, entries

These methods are generic, there is a common agreement to use them for data structures. If we ever create a data structure of our own, we should implement them too.

They are supported for:

Map
Set
Array

Object.keys(obj) – returns an array of keys.
Object.values(obj) – returns an array of values.
Object.entries(obj) – returns an array of [key, value] pairs.

https://javascript.info/keys-values-entries

@fullStackDevs
👍1
#Js
#Function

JavaScript Functions 4 ways

1️⃣ Functions Declaration

A function created with a function declaration is a Function object and has all the properties, methods and behavior of Function objects.

2️⃣ Functions Expression

The function keyword can be used to define a function inside an expression.

The main difference between a function expression and a function declaration is the function name .

3️⃣ Arrow Function Expression

An arrow function expression is a compact alternative to a traditional function expression, but is limited and can't be used in all situations.

4️⃣ Concise Arrow Function Expression

Arrow functions can have either a "concise body" or the usual "block body".

In a concise body, only an expression is specified, which becomes the implicit return value. In a block body, you must use an explicit
return
statement.

@fullStackDevs
👍1
👍1
#frontend #css #html #js

Here i gathered an awesome front-end roadmap in 2022 to start our journey🎯🔥

🔻Internet (Web)
• How internet works?
• Whats http protocol?
• How browsers work?
• DNS
• Hosting and domains

🔻HTML
• Tags
• SEO
• Metatags
• Forms and validations
• Convention and best practices

🔻CSS
• Selectors
• Box model
• Flexbox
• Grid
• Responsive Design (Media Query)
• Sass / less

🔻JavaScript
• Syntax and Basics
• Data types
• Operators
• Object
• Selectors
• Functions
• Arrays
• DOM
• API / Ajax (XHR)
• ES6

🔻Version Control System (Git)
• Basic usage of Git
• CLI
• Github
• Git Flow

🔻Package Managers
• NPM
• YARN
• Local vs Global
• Package JSON

🔻Framework / LIB
• Angular
• ReactJS
• VueJS


If i left something let me know on comments🤔

👉🏻 Follow for more Tips :
instagram.com/yashar_dev


@fullStackDevs
👍6