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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/pgimg/71
[ Website ] : http://bit.do/ksim
γ°γ°γ°γ°γ°γ°
#JavaScript #ES6 #Tutorial
@ProgrammingTip
https://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/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 javascript 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://t.me/pgimg/76
[ Article ] : http://bit.do/es6
γ°γ°γ°γ°γ°γ°
#JavaScript #ES6
@ProgrammingTip
ES6 brings many new features to vanilla javascript 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://t.me/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://t.me/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://t.me/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://t.me/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://t.me/pgimg/78
[ Github ] : http://bit.do/flval
γ°γ°γ°γ°γ°γ°
#CSharp #AspMvc #Validation
@ProgrammingTip
Telegram
Programming Tips Resources