ASP.NET Core Web Optimizer ⚡️
ASP.NET Core middleware for bundling and minification of CSS and JavaScript files at runtime. ⌛️
With full server-side and client-side caching to ensure high performance. 💨
No complicated build process and no hassle. ✅
🔸🔹🔸🔹
Installation 📥 :
1️⃣ Add the NuGet package LigerShark.WebOptimizer.Core to any ASP.NET Core 2.0 project :
2️⃣ Add this to Configure in Startup.cs before app.UseStaticFiles :
3️⃣ Finally add this to ConfigureServices :
That's it. 🤚🏻
You have now enabled automatic CSS and JavaScript minification. 💎
🔸🔹🔸🔹
Features 🔥 :
• Minification
• Bundling
• Cache Busting
• Inlining Content
• Compiling SCSS
• Compiling LESS
• Compiling TypeScript
https://news.1rj.ru/str/pgimg/60
[ Demo ] : http://bit.do/optde
[ Github ] : http://bit.do/optgit
〰〰〰〰〰〰
#AspMvc #Core #Bundling #Minify
@ProgrammingTip
ASP.NET Core middleware for bundling and minification of CSS and JavaScript files at runtime. ⌛️
With full server-side and client-side caching to ensure high performance. 💨
No complicated build process and no hassle. ✅
🔸🔹🔸🔹
Installation 📥 :
1️⃣ Add the NuGet package LigerShark.WebOptimizer.Core to any ASP.NET Core 2.0 project :
dotnet add package LigerShark.WebOptimizer.Core
2️⃣ Add this to Configure in Startup.cs before app.UseStaticFiles :
app.UseWebOptimizer();
3️⃣ Finally add this to ConfigureServices :
services.AddWebOptimizer();
That's it. 🤚🏻
You have now enabled automatic CSS and JavaScript minification. 💎
🔸🔹🔸🔹
Features 🔥 :
• Minification
• Bundling
• Cache Busting
• Inlining Content
• Compiling SCSS
• Compiling LESS
• Compiling TypeScript
https://news.1rj.ru/str/pgimg/60
[ Demo ] : http://bit.do/optde
[ Github ] : http://bit.do/optgit
〰〰〰〰〰〰
#AspMvc #Core #Bundling #Minify
@ProgrammingTip
Telegram
Programming Tips Resources
JavaScript — Double Equals VS Triple Equals ✨
JavaScript has two visually similar, yet very different, ways to test equality. 🤓
You can test equality with == or === 🔅
Triple Equals ✅
When using triple equals === in JavaScript, we are testing for strict equality.
This means both the type and the value we are comparing have to be the same.
Example :
🔹🔸🔹🔸
Double equals ✅
When using double equals in JavaScript we are testing for loose equality.
Double equals also performs type coercion.
Example :
https://news.1rj.ru/str/pgimg/61
[ Article ] : http://bit.do/jseq
〰〰〰〰〰〰
#JavaScript #Equality
@ProgrammingTip
JavaScript has two visually similar, yet very different, ways to test equality. 🤓
You can test equality with == or === 🔅
Triple Equals ✅
When using triple equals === in JavaScript, we are testing for strict equality.
This means both the type and the value we are comparing have to be the same.
Example :
77 === '77'
// false (Number v. String)
🔹🔸🔹🔸
Double equals ✅
When using double equals in JavaScript we are testing for loose equality.
Double equals also performs type coercion.
Example :
77 == '77'
// true
https://news.1rj.ru/str/pgimg/61
[ Article ] : http://bit.do/jseq
〰〰〰〰〰〰
#JavaScript #Equality
@ProgrammingTip
Telegram
Programming Tips Resources
Write tests,
Not too many,
Mostly integration. ✅
A while back, Guillermo Rauch ( Creator of Socket.io ) tweeted something profound :
This is deep, albeit short, so let’s dive in. 🌀
https://news.1rj.ru/str/pgimg/62
[ Article ] : http://bit.do/iut
〰〰〰〰〰〰
#UnitTest
@ProgrammingTip
Not too many,
Mostly integration. ✅
A while back, Guillermo Rauch ( Creator of Socket.io ) tweeted something profound :
Write tests. Not too many. Mostly integration.💎
This is deep, albeit short, so let’s dive in. 🌀
https://news.1rj.ru/str/pgimg/62
[ Article ] : http://bit.do/iut
〰〰〰〰〰〰
#UnitTest
@ProgrammingTip
Telegram
Programming Tips Resources
Forwarded from Code Tweets 🐝
This media is not supported in your browser
VIEW IN TELEGRAM
PopSQL ✨
Modern, collaborative SQL editor for your team. 🗂
🔹Collaborate in realtime, just like a Google Doc
🔹Share queries by URL, and organize them in folders
🔹Visualize your data automatically
🔹Works with many types of databases
https://news.1rj.ru/str/pgimg/65
[ Website ] : popsql.io
〰〰〰〰〰〰
#SQL #Database #Tools
@ProgrammingTip
Modern, collaborative SQL editor for your team. 🗂
🔹Collaborate in realtime, just like a Google Doc
🔹Share queries by URL, and organize them in folders
🔹Visualize your data automatically
🔹Works with many types of databases
https://news.1rj.ru/str/pgimg/65
[ Website ] : popsql.io
〰〰〰〰〰〰
#SQL #Database #Tools
@ProgrammingTip
Telegram
Programming Tips Resources
Axosoft GitKraken: Unleash Your Repo! 🐙
The legendary Git GUI client for Windows, Mac and Linux. 🐧
Axosoft GitKraken is a Git client with efficiency, elegance and reliability at the core. It was made for devs by devs. 🤘
Features
You can do all the standard things you should be able to do with a git client; branching, merging, pulling, pushing, reverting, etc. ✨
The range of options you have for each commit 🔥
🔹 Set Upsteam
🔸 Branch from a historic commit
🔹 Cherrypick from commit
🔸 Revert the commit
🔹 Edit the commit message
🔸 Deleting the commit (and remote versions of it)
🔹 Creating a tag from a commit
https://news.1rj.ru/str/pgimg/66
[Website] : https://gitkraken.com
〰〰〰〰〰〰
#Git #VCS
@ProgrammingTip
The legendary Git GUI client for Windows, Mac and Linux. 🐧
Axosoft GitKraken is a Git client with efficiency, elegance and reliability at the core. It was made for devs by devs. 🤘
Features
You can do all the standard things you should be able to do with a git client; branching, merging, pulling, pushing, reverting, etc. ✨
The range of options you have for each commit 🔥
🔹 Set Upsteam
🔸 Branch from a historic commit
🔹 Cherrypick from commit
🔸 Revert the commit
🔹 Edit the commit message
🔸 Deleting the commit (and remote versions of it)
🔹 Creating a tag from a commit
https://news.1rj.ru/str/pgimg/66
[Website] : https://gitkraken.com
〰〰〰〰〰〰
#Git #VCS
@ProgrammingTip
Telegram
Programming Tips Resources
Import and export in ES6 📚
Export is ES6' way of saying 🗣 :
Import is the opposite, and tries to get code from other modules.
🔹What is modules❓
🔸Diffrence between export and export default
https://news.1rj.ru/str/pgimg/67
[ Article ] : https://goo.gl/EJ3e6H
〰〰〰〰〰〰
#JavaScript #ES6 #Modules
@ProgrammingTip
Export is ES6' way of saying 🗣 :
“Make this code available for other modules.”
Import is the opposite, and tries to get code from other modules.
🔹What is modules❓
🔸Diffrence between export and export default
https://news.1rj.ru/str/pgimg/67
[ Article ] : https://goo.gl/EJ3e6H
〰〰〰〰〰〰
#JavaScript #ES6 #Modules
@ProgrammingTip
Telegram
Programming Tips Resources
NGX Toastr 💎
Easy Toasts for Angular 🅰️
🔹🔸🔹🔸
Features ✨:
• Toast Component Injection without being passed ViewContainerRef
〰〰〰
• No use of *ngFor. Fewer dirty checks and higher performance.
〰〰〰
• AoT compilation and lazy loading compatible
〰〰〰
• Component inheritance for custom toasts
〰〰〰
• SystemJS/UMD rollup bundle
〰〰〰
• Animations using Angular's Web Animations API
〰〰〰
• Output toasts to an optional target directive
〰〰〰
• Individual Options
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/68
[ Github ] : http://bit.do/ngxg
[ Demo ] : http://bit.do/ngxd
〰〰〰〰〰〰
#Angular #Notification #Toastr
@ProgrammingTip
Easy Toasts for Angular 🅰️
🔹🔸🔹🔸
Features ✨:
• Toast Component Injection without being passed ViewContainerRef
〰〰〰
• No use of *ngFor. Fewer dirty checks and higher performance.
〰〰〰
• AoT compilation and lazy loading compatible
〰〰〰
• Component inheritance for custom toasts
〰〰〰
• SystemJS/UMD rollup bundle
〰〰〰
• Animations using Angular's Web Animations API
〰〰〰
• Output toasts to an optional target directive
〰〰〰
• Individual Options
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/68
[ Github ] : http://bit.do/ngxg
[ Demo ] : http://bit.do/ngxd
〰〰〰〰〰〰
#Angular #Notification #Toastr
@ProgrammingTip
Telegram
Programming Tips Resources
File Ultimate 🔥
File manager control for integrating file browsing, upload & download features into your ASP.NET MVC & WebForms application or site rapidly. 💎
Supports ✨ :
• ASP.NET Web Forms ( C# )
• ASP.NET Web Forms ( VB )
• ASP.NET MVC ( C# )
• ASP.NET MVC ( VB )
Features ⚡️ :
• Browse and manage files with access control.
• Accept files with the advanced upload functionality.
• Offer a structured and neat download area.
• Preview documents (70+ file formats, including PDF © Microsoft Office), images, audios and videos.
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/69
[ Github ] : http://bit.do/fgit
[ Demo ] : http://bit.do/fmade
〰〰〰〰〰〰
#AspMvc #FileManager #Uploader
@ProgrammingTip
File manager control for integrating file browsing, upload & download features into your ASP.NET MVC & WebForms application or site rapidly. 💎
Supports ✨ :
• ASP.NET Web Forms ( C# )
• ASP.NET Web Forms ( VB )
• ASP.NET MVC ( C# )
• ASP.NET MVC ( VB )
Features ⚡️ :
• Browse and manage files with access control.
• Accept files with the advanced upload functionality.
• Offer a structured and neat download area.
• Preview documents (70+ file formats, including PDF © Microsoft Office), images, audios and videos.
🔹🔸🔹🔸
https://news.1rj.ru/str/pgimg/69
[ Github ] : http://bit.do/fgit
[ Demo ] : http://bit.do/fmade
〰〰〰〰〰〰
#AspMvc #FileManager #Uploader
@ProgrammingTip
Telegram
Programming Tips Resources
Cool, the " Ranges " feature is planned for C# 7.3❗️
[ Github ] : http://bit.do/csran
〰〰〰〰〰〰
#CSharp
@ProgrammingTip
[ Github ] : http://bit.do/csran
〰〰〰〰〰〰
#CSharp
@ProgrammingTip
What is Dynamic Proxy❓
A proxy, in its most general form, is a class functioning as an interface to something else. ↗️
The proxy could interface to anything :
• A network connection 🌐
• A large object in memory 🗂
• A file 📄
• Some other resource that is expensive or impossible to duplicate. 💸
🔹🔸🔹🔸🔹🔸
One way of thinking about proxies, is by the analogy to The Matrix 🕶 by Krzysztof Koźmic 🤔 :
A dynamic proxy is a proxy that is generated on the fly at runtime. ✅
https://news.1rj.ru/str/pgimg/70
〰〰〰〰〰〰
#Proxy #DynamicProxy
@ProgrammingTip
A proxy, in its most general form, is a class functioning as an interface to something else. ↗️
The proxy could interface to anything :
• A network connection 🌐
• A large object in memory 🗂
• A file 📄
• Some other resource that is expensive or impossible to duplicate. 💸
🔹🔸🔹🔸🔹🔸
One way of thinking about proxies, is by the analogy to The Matrix 🕶 by Krzysztof Koźmic 🤔 :
“People in the matrix aren’t the actual people ( “The spoon does not exist”, remember❓)
They’re proxies to the actual people that can be… wherever.🌍
They look like ones, they behave like ones, but at the same time, they are not them actually.🙅🏻♂️
Another implication is the fact that different rules apply to proxies.✳️
Proxies can be what the proxied objects are, but they can be more (flying, running away from bullets, that kind of stuff).✈️
One more important thing, is that proxies ultimately delegate the behavior to the actual objects behind them (kind of like – “if you’re killed in the matrix, you die in the real life as well”☠️).”
A dynamic proxy is a proxy that is generated on the fly at runtime. ✅
https://news.1rj.ru/str/pgimg/70
〰〰〰〰〰〰
#Proxy #DynamicProxy
@ProgrammingTip
Telegram
Programming Tips Resources
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