All Kyle Simpson's (You Don't Know JS author) courses are free 💸 untill the next monday❗️
https://news.1rj.ru/str/pgimg/71
[ Website ] : http://bit.do/ksim
〰〰〰〰〰〰
#JavaScript #ES6 #Tutorial
@ProgrammingTip
https://news.1rj.ru/str/pgimg/71
[ Website ] : http://bit.do/ksim
〰〰〰〰〰〰
#JavaScript #ES6 #Tutorial
@ProgrammingTip
Telegram
Programming Tips Resources
Semantic UI React ⚛️
Semantic UI React is the official React integration for Semantic UI .🙅🏻♂️
🔸 jQuery Free
🔹 Declarative API
🔸 Augmentation
🔹 Shorthand Props
🔸 Sub Components
🔹 Auto Controlled State
https://news.1rj.ru/str/pgimg/72
[ Usage ] : https://react.semantic-ui.com/usage
[ Website ] : https://react.semantic-ui.com
〰〰〰〰〰〰
#React #Semantic #FrontEnd
@ProgrammingTip
Semantic UI React is the official React integration for Semantic UI .🙅🏻♂️
🔸 jQuery Free
🔹 Declarative API
🔸 Augmentation
🔹 Shorthand Props
🔸 Sub Components
🔹 Auto Controlled State
https://news.1rj.ru/str/pgimg/72
[ Usage ] : https://react.semantic-ui.com/usage
[ Website ] : https://react.semantic-ui.com
〰〰〰〰〰〰
#React #Semantic #FrontEnd
@ProgrammingTip
Telegram
Programming Tips Resources
The difference between ForEach, and For… In 💫
This is going to be a quick introduction to foreach, and for...in in JavaScript. ☝🏻
This article was written to introduce you to new methods that you can you can use instead of always using for loops.⚡️
https://news.1rj.ru/str/pgimg/73
[ Article ] : http://bit.do/jsfor
〰〰〰〰〰〰
#JavaScript
@ProgrammingTip
This is going to be a quick introduction to foreach, and for...in in JavaScript. ☝🏻
This article was written to introduce you to new methods that you can you can use instead of always using for loops.⚡️
https://news.1rj.ru/str/pgimg/73
[ Article ] : http://bit.do/jsfor
〰〰〰〰〰〰
#JavaScript
@ProgrammingTip
Telegram
Programming Tips Resources
Angular 4 Custom Validation for Template Driven forms 🅰️
This article consists an example for a custom email validator using regex. 🌐
Angular 4 Already has a built-in validator for this “ng-pattern”. ⚠️
But this article is more focused on creating a base for custom validators so you could improve and use it for other use cases. 💎
Usage :
https://news.1rj.ru/str/pgimg/74
[ Website ] : http://bit.do/anva
〰〰〰〰〰〰
#JavaScript #Angular #Forms
@ProgrammingTip
This article consists an example for a custom email validator using regex. 🌐
Angular 4 Already has a built-in validator for this “ng-pattern”. ⚠️
But this article is more focused on creating a base for custom validators so you could improve and use it for other use cases. 💎
Usage :
<input type="email" emailvalidator>
https://news.1rj.ru/str/pgimg/74
[ Website ] : http://bit.do/anva
〰〰〰〰〰〰
#JavaScript #Angular #Forms
@ProgrammingTip
Telegram
Programming Tips Resources
Improving ASP.NET MVC Routing Configuration ✅
This post covers some ways you can improve the testability and reduce framework coupling when configuring routing in an ASP.NET MVC application. 🔥
https://news.1rj.ru/str/pgimg/75
[ Article ] : http://bit.do/aspcr
〰〰〰〰〰〰
#AspMvc #Decoupling
@ProgrammingTip
This post covers some ways you can improve the testability and reduce framework coupling when configuring routing in an ASP.NET MVC application. 🔥
https://news.1rj.ru/str/pgimg/75
[ Article ] : http://bit.do/aspcr
〰〰〰〰〰〰
#AspMvc #Decoupling
@ProgrammingTip
Telegram
Programming Tips Resources
Why I am in love with ES6❓
ES6 brings many new features to vanilla javanoscript making the language do more with less syntax. 🔥
New features like let and fat arrows let us manage scope very easily too. 🙇🏻
Some of ES6 new features 💎 :
• Fat arrows
• Rest/Spread Operators
• Object Deconstruction
• Default Parameters
• import & export keywords
https://news.1rj.ru/str/pgimg/76
[ Article ] : http://bit.do/es6
〰〰〰〰〰〰
#JavaScript #ES6
@ProgrammingTip
ES6 brings many new features to vanilla javanoscript making the language do more with less syntax. 🔥
New features like let and fat arrows let us manage scope very easily too. 🙇🏻
Some of ES6 new features 💎 :
• Fat arrows
• Rest/Spread Operators
• Object Deconstruction
• Default Parameters
• import & export keywords
https://news.1rj.ru/str/pgimg/76
[ Article ] : http://bit.do/es6
〰〰〰〰〰〰
#JavaScript #ES6
@ProgrammingTip
Telegram
Programming Tips Resources
Writing middleware for use in Express.js apps 🔥
Overview 🔎
Middleware functions are functions that have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle.
The next function is a function in the Express router which, when invoked, executes the middleware succeeding the current middleware. ⏭
Middleware can perform 💎
• Execute any code.
• Make changes to the request and the response objects.
• End the request-response cycle.
• Call the next middleware in the stack.
🔸🔹🔸🔹
Configurable middleware 📥
If you need your middleware to be configurable, export a function which accepts an options object or other parameters, which, then returns the middleware implementation based on the input parameters.
🔸🔹🔸🔹
Usage Middleware 📤
The middleware can now be used as shown below.
https://news.1rj.ru/str/pgimg/77
〰〰〰〰〰〰
#JavaScript #Express #Middleware
@ProgrammingTip
Overview 🔎
Middleware functions are functions that have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle.
The next function is a function in the Express router which, when invoked, executes the middleware succeeding the current middleware. ⏭
Middleware can perform 💎
• Execute any code.
• Make changes to the request and the response objects.
• End the request-response cycle.
• Call the next middleware in the stack.
🔸🔹🔸🔹
Configurable middleware 📥
If you need your middleware to be configurable, export a function which accepts an options object or other parameters, which, then returns the middleware implementation based on the input parameters.
in my-middleware.js
module.exports = function(options) {
return function(req, res, next) {
// Implement the middleware function
next();
}
}🔸🔹🔸🔹
Usage Middleware 📤
The middleware can now be used as shown below.
const mddleware = require('./my-middleware.js')
app.use(mddleware({ option1: '1', option2: '2' }))https://news.1rj.ru/str/pgimg/77
〰〰〰〰〰〰
#JavaScript #Express #Middleware
@ProgrammingTip
Telegram
Programming Tips Resources
Fluent Validation ⚠️
A small validation library for .NET that uses a fluent interface and lambda expressions for building validation rules. 🚫
NuGet Packages :
For ASP.NET MVC integration :
For ASP.NET Core :
🔹🔸🔹🔸
Example :
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/78
[ Github ] : http://bit.do/flval
〰〰〰〰〰〰
#CSharp #AspMvc #Validation
@ProgrammingTip
A small validation library for .NET that uses a fluent interface and lambda expressions for building validation rules. 🚫
NuGet Packages :
Install-Package FluentValidation
For ASP.NET MVC integration :
Install-Package FluentValidation.MVC5
For ASP.NET Core :
Install-Package FluentValidation.AspNetCore
🔹🔸🔹🔸
Example :
public class PersonValidator : AbstractValidator<Person>
{
public PersonValidator()
{
RuleFor(x => x.ID).NotEmpty();
RuleFor(x => x.FirstName)
.NotEmpty()
.WithMessage("{PropertyName} is required !")
.MinimumLength(5)
.WithMessage("Minimum length for {PropertyName} is {MinLength} !");
RuleFor(x => x.LastName)
.NotEmpty()
.WithMessage("{PropertyName} is required !")
.MinimumLength(5)
.WithMessage("Minimum length for {PropertyName} is {MinLength} !");
RuleFor(x => x.Email)
.NotEmpty()
.WithMessage("{PropertyName} is required !")
.EmailAddress()
.WithMessage("{PropertyName} is not valid !");
}
}
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/78
[ Github ] : http://bit.do/flval
〰〰〰〰〰〰
#CSharp #AspMvc #Validation
@ProgrammingTip
Telegram
Programming Tips Resources
Polly 🕊
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. ♻️
Installing via NuGet 🗃 :
Usage :
We retry to send the email 3 times if something failed ❌ :
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/79
[ Github ] : http://bit.do/pollyc
〰〰〰〰〰〰
#CSharp #RetryPattern
@ProgrammingTip
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. ♻️
Installing via NuGet 🗃 :
Install-Package Polly
Usage :
public class Mailer
{
public static bool SendEmail()
{
Console.WriteLine("Sending Mail ...");
// simulate error
Random rnd = new Random();
var rndNumber = rnd.Next(1, 10);
if (rndNumber != 3)
throw new SmtpFailedRecipientException();
Console.WriteLine("Mail Sent successfully");
return true;
}
}
We retry to send the email 3 times if something failed ❌ :
var policy = Policy.Handle<SmtpFailedRecipientException>().Retry(3);
policy.Execute(Mailer.SendEmail);
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/79
[ Github ] : http://bit.do/pollyc
〰〰〰〰〰〰
#CSharp #RetryPattern
@ProgrammingTip
Telegram
Programming Tips Resources
Keyv 🗂
Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. ⚡️
It supports TTL based expiry, making it suitable as a cache or a persistent key-value store. ⏰
By default everything is stored in memory, you can optionally also install a storage adapter. 🗄
Supported Storage Adapters ✅ :
• Redis
• Mongo
• SQLite
• Postgres
• MySQL
https://news.1rj.ru/str/pgimg/80
[ Website ] : http://bit.do/keyv
〰〰〰〰〰〰
#JavaScript #KeyValue #Storage
@ProgrammingTip
Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. ⚡️
It supports TTL based expiry, making it suitable as a cache or a persistent key-value store. ⏰
By default everything is stored in memory, you can optionally also install a storage adapter. 🗄
Supported Storage Adapters ✅ :
• Redis
• Mongo
• SQLite
• Postgres
• MySQL
https://news.1rj.ru/str/pgimg/80
[ Website ] : http://bit.do/keyv
〰〰〰〰〰〰
#JavaScript #KeyValue #Storage
@ProgrammingTip
Telegram
Programming Tips Resources
JavaScript - Map vs. ForEach 🗺
What’s the difference between Map and ForEach in JavaScript❓
Let’s first take a look at the definitions on MDN 🌀 :
• forEach() ➖ executes a provided function once for each array element.
• map() ➖ creates a new array with the results of calling a provided function on every element in the calling array.
What exactly does this mean❔
https://news.1rj.ru/str/pgimg/81
[ Article ] : http://bit.do/mapjs
〰〰〰〰〰〰
#JavaScript #ForEach #Map
@ProgrammingTip
What’s the difference between Map and ForEach in JavaScript❓
Let’s first take a look at the definitions on MDN 🌀 :
• forEach() ➖ executes a provided function once for each array element.
• map() ➖ creates a new array with the results of calling a provided function on every element in the calling array.
What exactly does this mean❔
https://news.1rj.ru/str/pgimg/81
[ Article ] : http://bit.do/mapjs
〰〰〰〰〰〰
#JavaScript #ForEach #Map
@ProgrammingTip
Telegram
Programming Tips Resources
dbForge Event Profiler ⚡️
dbForge Event Profiler for SQL Server is a FREE tool that allows you to capture and analyze SQL Server events. ☁️
The events and data columns are stored in a physical trace file for later examination. 📋
You can use this information to identify and troubleshoot many SQL Server-related problems. 🐞
https://news.1rj.ru/str/pgimg/83
[ Download ] : https://news.1rj.ru/str/pgimg/84
[ Website ] : http://bit.do/dbfor
〰〰〰〰〰〰
#SQLServer #Profiler #DbForge
@ProgrammingTip
dbForge Event Profiler for SQL Server is a FREE tool that allows you to capture and analyze SQL Server events. ☁️
The events and data columns are stored in a physical trace file for later examination. 📋
You can use this information to identify and troubleshoot many SQL Server-related problems. 🐞
https://news.1rj.ru/str/pgimg/83
[ Download ] : https://news.1rj.ru/str/pgimg/84
[ Website ] : http://bit.do/dbfor
〰〰〰〰〰〰
#SQLServer #Profiler #DbForge
@ProgrammingTip
Telegram
Programming Tips Resources
Passport.Js ⚡️
Passport is authentication middleware for Node.js.
Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application. 🔥
A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more. 🐦
https://news.1rj.ru/str/pgimg/85
[ Website ] : passportjs.org
〰〰〰〰〰〰
#JavaScript #NodeJs #Authentication
@ProgrammingTip
Passport is authentication middleware for Node.js.
Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application. 🔥
A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more. 🐦
https://news.1rj.ru/str/pgimg/85
[ Website ] : passportjs.org
〰〰〰〰〰〰
#JavaScript #NodeJs #Authentication
@ProgrammingTip
Telegram
Programming Tips Resources
Xamarin VS Ionic VS React Native 🔥
Traditionally, Android applications are developed in Java, and iOS ones are written in Swift and Objective-C. ⚛️
Nevertheless, there exist plenty of other alternate tools that can be used instead. 👨🏻💻
Xamarin, React Native and Ionic are popular examples of such tools. 💎
What is their purpose❓
What makes them different❓
Which of them is the best❓
We’ll try to answer these questions in the article below. ⬇️
https://news.1rj.ru/str/pgimg/86
[ Article ] : http://bit.do/cpfo
〰〰〰〰〰〰
#Xamarin #ReactNative #Ionic
@ProgrammingTip
Traditionally, Android applications are developed in Java, and iOS ones are written in Swift and Objective-C. ⚛️
Nevertheless, there exist plenty of other alternate tools that can be used instead. 👨🏻💻
Xamarin, React Native and Ionic are popular examples of such tools. 💎
What is their purpose❓
What makes them different❓
Which of them is the best❓
We’ll try to answer these questions in the article below. ⬇️
https://news.1rj.ru/str/pgimg/86
[ Article ] : http://bit.do/cpfo
〰〰〰〰〰〰
#Xamarin #ReactNative #Ionic
@ProgrammingTip
Telegram
Programming Tips Resources
Quick Tip: How to pass visual alerts with an HTMLHelper⚠️
It will display a Bootstrap alert if there is a message passed through the ViewModel. 💥
This message can be a success, error, warning, or informational message. 🌈
The nice thing about the ViewMessage HtmlHelper is that if we don't pass it into our views, it won't display anything. 🎛
https://news.1rj.ru/str/pgimg/87
[ Article ] : http://bit.do/alhl
〰〰〰〰〰〰
#AspMvc #CleanCode
@ProgrammingTip
It will display a Bootstrap alert if there is a message passed through the ViewModel. 💥
This message can be a success, error, warning, or informational message. 🌈
The nice thing about the ViewMessage HtmlHelper is that if we don't pass it into our views, it won't display anything. 🎛
https://news.1rj.ru/str/pgimg/87
[ Article ] : http://bit.do/alhl
〰〰〰〰〰〰
#AspMvc #CleanCode
@ProgrammingTip
Telegram
Programming Tips Resources
Send ETag headers in ASP.NET Core ✨
ASP.NET Core doesn’t add an ETag header automatically to HTTP responses from MVC action methods or Razor Pages. ❌
We have to implement that ourselves to provide the users with true Conditional GET support that honors the If-None-Match request header. ✅
Wouldn’t it be nice if all we had to do was to register it using app.UseETagger() like this❓
https://news.1rj.ru/str/pgimg/88
[ Article ] : http://bit.do/etags
〰〰〰〰〰〰
#AspMvc #AspCore #ETag
@ProgrammingTip
ASP.NET Core doesn’t add an ETag header automatically to HTTP responses from MVC action methods or Razor Pages. ❌
We have to implement that ourselves to provide the users with true Conditional GET support that honors the If-None-Match request header. ✅
Wouldn’t it be nice if all we had to do was to register it using app.UseETagger() like this❓
https://news.1rj.ru/str/pgimg/88
[ Article ] : http://bit.do/etags
〰〰〰〰〰〰
#AspMvc #AspCore #ETag
@ProgrammingTip
Telegram
Programming Tips Resources
Automatic ModelState Validation in ASP.NET MVC 🔥
How many times have you seen or written code like this ♻️ :
Stop repeating ModelState checks in your ASP.NET MVC controller actions. ❌
Wouldn’t it be nice if all we had to do was like this ? ⚡️
https://news.1rj.ru/str/pgimg/89
[ Article ] : http://bit.do/msta
〰〰〰〰〰〰
#AspMvc #CleanCode
@ProgrammingTip
How many times have you seen or written code like this ♻️ :
[HttpPost]
public ActionResult Index(SomeModel model)
{
if (ModelState.IsValid)
{
return View();
}
// do something
return RedirectToAction("index");
}
Stop repeating ModelState checks in your ASP.NET MVC controller actions. ❌
Wouldn’t it be nice if all we had to do was like this ? ⚡️
[HttpPost]
[ValidateModelState]
public ActionResult Index(SomeModel model)
{
// if we get here, ModelState is valid
// save to db etc.
return RedirectToAction("index");
}
https://news.1rj.ru/str/pgimg/89
[ Article ] : http://bit.do/msta
〰〰〰〰〰〰
#AspMvc #CleanCode
@ProgrammingTip
Telegram
Programming Tips Resources
The state of JavaScript in 2017 🔥
A few years back, a JavaScript survey would've been a simple matter.
Question 1 :
Are you using jQuery❓
Question 2 :
Any comments❓Boom, done❗️
But as we all know, things have changed. ✨
The JavaScript ecosystem is richer than ever, and even the most experienced developer can start to hesitate when considering the multitude of options available at every stage.
There's data from over 20,000 developers, asking them questions on topics ranging from front-end frameworks and state management, to build tools and testing libraries. ✅
https://news.1rj.ru/str/pgimg/90
[ Website ] : https://stateofjs.com
〰〰〰〰〰〰
#JavaScript #Analytics
@ProgrammingTip
A few years back, a JavaScript survey would've been a simple matter.
Question 1 :
Are you using jQuery❓
Question 2 :
Any comments❓Boom, done❗️
But as we all know, things have changed. ✨
The JavaScript ecosystem is richer than ever, and even the most experienced developer can start to hesitate when considering the multitude of options available at every stage.
There's data from over 20,000 developers, asking them questions on topics ranging from front-end frameworks and state management, to build tools and testing libraries. ✅
https://news.1rj.ru/str/pgimg/90
[ Website ] : https://stateofjs.com
〰〰〰〰〰〰
#JavaScript #Analytics
@ProgrammingTip
Telegram
Programming Tips Resources
How we do MVC – View models 👀
The ViewModel is a central aspect of our MVC architecture. 🌞
One of the first dilemmas facing MVC developers is to decide what the “M” in MVC means in ASP.NET MVC. 🤔
In Rails, this is fairly clear, the M is ActiveRecord (by default). 🌍
But in ASP.NET MVC, the “M” is silent❗️
Its out-of-the-box architecture offers no guidelines nor advice on what the M should be. ⚙️
Should it be an entity❓
Data access object❔
DTO❓
Something else❔
https://news.1rj.ru/str/pgimg/91
[ Website ] : http://bit.do/mvvm
〰〰〰〰〰〰
#AspMvc #CleanCode #BestPractices
@ProgrammingTip
The ViewModel is a central aspect of our MVC architecture. 🌞
One of the first dilemmas facing MVC developers is to decide what the “M” in MVC means in ASP.NET MVC. 🤔
In Rails, this is fairly clear, the M is ActiveRecord (by default). 🌍
But in ASP.NET MVC, the “M” is silent❗️
Its out-of-the-box architecture offers no guidelines nor advice on what the M should be. ⚙️
Should it be an entity❓
Data access object❔
DTO❓
Something else❔
https://news.1rj.ru/str/pgimg/91
[ Website ] : http://bit.do/mvvm
〰〰〰〰〰〰
#AspMvc #CleanCode #BestPractices
@ProgrammingTip
Telegram
Programming Tips Resources
Working With Zip Files In ASP.NET MVC 🗂
Since ASP.NET 4.5, zipping and unzipping files can be done with classes from within the .NET framework. 📂
Despite that, nearly all examples that illustrate working with zip files in ASP.NET applications feature third party open source compression libraries. 👾
This short article attempts to correct that by demonstrating the use of the System.IO.Compression classes in an ASP.NET MVC application to ✅ :
1️⃣ Unpack an uploaded zip file
2️⃣ Create one for download
https://news.1rj.ru/str/pgimg/92
[ Article ] : http://bit.do/aspzip
〰〰〰〰〰〰
#AspMvc #Compression
@ProgrammingTip
Since ASP.NET 4.5, zipping and unzipping files can be done with classes from within the .NET framework. 📂
Despite that, nearly all examples that illustrate working with zip files in ASP.NET applications feature third party open source compression libraries. 👾
This short article attempts to correct that by demonstrating the use of the System.IO.Compression classes in an ASP.NET MVC application to ✅ :
1️⃣ Unpack an uploaded zip file
2️⃣ Create one for download
https://news.1rj.ru/str/pgimg/92
[ Article ] : http://bit.do/aspzip
〰〰〰〰〰〰
#AspMvc #Compression
@ProgrammingTip
Telegram
Programming Tips Resources