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
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
#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 میتونید متغیرهاتون رو خیلی سریع و خوانا لاگ بزنید.
به این ترتیب یه آبجکت میسازین و مقدار هر پراپرتیش به همراه نامش در کنسول لاگ میشه.
🔹نمایش نام پارامترهای تابع به همراه تایپ شون.
به کمک object destructuring در جاوا اسکریپت و مشخص کردن مقدار پیشفرض برای پارامتر های تابع میتونید موقع صدا زدن تابع نام پارامتر ها به همراه تایپ اونها رو داشته باشید و از آنجایی که به پارامترتون مقدار پیشفرض دادید به صورت optional هست و به شکل های متفاوت میتونید تابع تون رو صدا بزنید.
از اونجایی که ارایه ها با رفرنسشون پاس داده میشن به کمک spread operator میتونید یک آرایه رو به راحتی کلون کنید.
به کمک مقدار دهی پیشفرض برای پارامترهای تابع و به کمک این تکنیک میتونید پارامترهای توابع تون رو درصورتی که مقداری براشون پاس داده نشده اجباری کنید.
دیگر لایبری های رایج جاوااسکریپتی مثل jquery ajax و axios این امکان رو بهتون میدن تا برای درخواستتون یک timeout تنظیم کنین و درصورتی که در زمان مشخص شده رکوئست انجام نشد، خودکار fail بشه.
متد fetch در مرورگر های جدید به صورت توکار چنین قابلیتی رو نداره اما به کمک این تکنیک میتونید اینکار رو انجام بدید.
.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
//
})
🔹تبدیل رشته به عدد .
برای تبدیل رشته های عددی به معادل number ای شون از این تکنیک استفاده کنید.
@fullStackDevs
#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
#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
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
#CSS
#Transforms
The World of CSS Transforms
Like so many things in CSS, the transform property is surprisingly remarkable.
You can click on the link below to learn
https://www.joshwcomeau.com/css/transforms/
@fullStackDevs
#Transforms
The World of CSS Transforms
Like so many things in CSS, the transform property is surprisingly remarkable.
You can click on the link below to learn
https://www.joshwcomeau.com/css/transforms/
@fullStackDevs
Joshwcomeau
The World of CSS Transforms • Josh W. Comeau
The “transform” property is such a powerful part of the CSS language! In this blog post, we'll take a deep look at this property and see some of the nifty things it can do.
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
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
Forwarded from Web Devs
#جاوا_اسکریپت
با استفاده از متد console.table
میتونید آرایهای آبجکت ها رو در کنسول به جدول تبدیل کنید.
@fullStackDevs
با استفاده از متد 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
https://javascript.info/keys-values-entries
@fullStackDevs
#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
@fullStackDevs
#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
returnstatement.
@fullStackDevs
👍1
#css
:𝐢𝐬() 𝐒𝐞𝐥𝐞𝐜𝐭𝐨𝐫 𝐈𝐧 𝐂𝐬𝐬
https://developer.mozilla.org/en-US/docs/Web/CSS/:is
https://css-tricks.com/almanac/selectors/i/is/
Browsers support of ":is"
https://caniuse.com/css-matches-pseudo
@fullStackDevs
:𝐢𝐬() 𝐒𝐞𝐥𝐞𝐜𝐭𝐨𝐫 𝐈𝐧 𝐂𝐬𝐬
https://developer.mozilla.org/en-US/docs/Web/CSS/:is
https://css-tricks.com/almanac/selectors/i/is/
Browsers support of ":is"
https://caniuse.com/css-matches-pseudo
@fullStackDevs
👍1
Forwarded from Full Stack Amigo (HESAM KASHEFI)
YouTube
Indecies and Ranges in C#
What is Index and What is Range in C#?
How to slice arrays in C#
How to index from end of arrays?
Hot to substring with index and range in C#?
😀 QUESTIONS? ▶ COMMENT
🔴 SUBSCRIBE: https://bit.ly/39PJJ8Z
🔴 LIKE SHARE SUBSCRIBE
▶ SOCIAL MEDIA:
Instagram:…
How to slice arrays in C#
How to index from end of arrays?
Hot to substring with index and range in C#?
😀 QUESTIONS? ▶ COMMENT
🔴 SUBSCRIBE: https://bit.ly/39PJJ8Z
🔴 LIKE SHARE SUBSCRIBE
▶ SOCIAL MEDIA:
Instagram:…
👍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
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