Pug 🐶
Pug is a high-performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers. ✅
Pug is a clean, whitespace sensitive syntax for writing html. 🌐
Here is a simple example 💎 :
Becomes :
🔸🔹🔸🔹
➖ Implementations in other languages 👾
Ports with very close syntax, adapted to other languages :
• PHP
• Java
• Python
• Ruby
• C# (ASP.NET Core)
https://news.1rj.ru/str/pgimg/108
[ Github ] : http://bit.do/pugv
〰〰〰〰〰〰
#ViewEngine #TemplateEngine
@ProgrammingTip
Pug is a high-performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers. ✅
Pug is a clean, whitespace sensitive syntax for writing html. 🌐
Here is a simple example 💎 :
doctype html
html(lang="en")
head
noscript= pageTitle
noscript(type='text/javanoscript').
if (foo) bar(1 + 5)
body
h1 Pug - node template engine
#container.col
if youAreUsingPug
p You are amazing
else
p Get on it!
p.
Pug is a terse and simple templating language with a
strong focus on performance and powerful features.
Becomes :
<!DOCTYPE html>
<html lang="en">
<head>
<noscript>Pug</noscript>
<noscript type="text/javanoscript">
if (foo) bar(1 + 5)
</noscript>
</head>
<body>
<h1>Pug - node template engine</h1>
<div id="container" class="col">
<p>You are amazing</p>
<p>Pug is a terse and simple templating language with a strong focus on performance and powerful features.</p>
</div>
</body>
</html>
🔸🔹🔸🔹
➖ Implementations in other languages 👾
Ports with very close syntax, adapted to other languages :
• PHP
• Java
• Python
• Ruby
• C# (ASP.NET Core)
https://news.1rj.ru/str/pgimg/108
[ Github ] : http://bit.do/pugv
〰〰〰〰〰〰
#ViewEngine #TemplateEngine
@ProgrammingTip
Telegram
Programming Tips Resources
Using Google reCAPTCHA in ASP.NET MVC 👾
reCAPTCHA is a free service that protects your website from spam and abuse. ✅
reCAPTCHA uses an advanced risk analysis engine and adaptive Captchas to keep automated software from engaging in abusive activities on your site. 🚫
It does this while letting your valid users pass through with ease. 💎
This article shows how to integrate reCAPTCHA version 2.0 into an ASP.NET MVC website in clean way. ⚡️
Article Author : @MoienTJ
https://news.1rj.ru/str/pgimg/109
[ Article ] : bit.do/recaptcha
〰〰〰〰〰〰
#reCaptcha #AspMvc
@ProgrammingTip
reCAPTCHA is a free service that protects your website from spam and abuse. ✅
reCAPTCHA uses an advanced risk analysis engine and adaptive Captchas to keep automated software from engaging in abusive activities on your site. 🚫
It does this while letting your valid users pass through with ease. 💎
This article shows how to integrate reCAPTCHA version 2.0 into an ASP.NET MVC website in clean way. ⚡️
Article Author : @MoienTJ
https://news.1rj.ru/str/pgimg/109
[ Article ] : bit.do/recaptcha
〰〰〰〰〰〰
#reCaptcha #AspMvc
@ProgrammingTip
Telegram
Programming Tips Resources
Securing ASP.NET Core 2.0 Applications with JWTs + Auth0 🔑
JSON Web Tokens, often shortened with JWTs, are gathering more and more popularity in the Web environment. 🌐
It is an open standard that allows transmitting data between parties as a JSON object in a compact and secure way. 🔁
They are usually used in authentication and information exchange scenarios, since the data transmitted between a source and a target are digitally signed so that they can be easily verified and trusted. ✅
Let's take a look at how to set up a ASP.NET Core 2 application with JWT support by creating a Web API application. ✨
https://news.1rj.ru/str/pgimg/110
[ Article ] : http://bit.do/auth0
〰〰〰〰〰〰
#AspMvc #Core #JWT
@ProgrammingTip
JSON Web Tokens, often shortened with JWTs, are gathering more and more popularity in the Web environment. 🌐
It is an open standard that allows transmitting data between parties as a JSON object in a compact and secure way. 🔁
They are usually used in authentication and information exchange scenarios, since the data transmitted between a source and a target are digitally signed so that they can be easily verified and trusted. ✅
Let's take a look at how to set up a ASP.NET Core 2 application with JWT support by creating a Web API application. ✨
https://news.1rj.ru/str/pgimg/110
[ Article ] : http://bit.do/auth0
〰〰〰〰〰〰
#AspMvc #Core #JWT
@ProgrammingTip
Telegram
Programming Tips Resources
A Pattern is a solution to a problem in a context. ✅
We're going to step throught each of these parts, context, problem and solution ✨ :
The context is the situation in which the pattern applies. This should be a recurring situation. 👨🏻🔧
The problem refers to the goal you are trying acheive in this context, but it also refers to any constraints that occur in the context. 🏆
The solution is what you're after : a general design that anyone can apply which resolves the goal and set of constraints. 🏅
➖ Example
Problem: How do I get to work on time❓
Context: I've locked my keys in the car. 🗝
Solution: Break the window, get in the car, start the engine and drive to work. 🚗
〰〰〰〰〰〰
#DesignPatterns #Tips
@ProgrammingTip
We're going to step throught each of these parts, context, problem and solution ✨ :
The context is the situation in which the pattern applies. This should be a recurring situation. 👨🏻🔧
The problem refers to the goal you are trying acheive in this context, but it also refers to any constraints that occur in the context. 🏆
The solution is what you're after : a general design that anyone can apply which resolves the goal and set of constraints. 🏅
➖ Example
Problem: How do I get to work on time❓
Context: I've locked my keys in the car. 🗝
Solution: Break the window, get in the car, start the engine and drive to work. 🚗
"If you find yourself in a context with a problem that has a goal that is affected by a set of constraints, then you can apply a design that resolves the goal and constraints and leads to a solution."
〰〰〰〰〰〰
#DesignPatterns #Tips
@ProgrammingTip
If you don't need it now, don't do it now❗️
Design Patterns are powerful, and it's easy to see all kinds of ways they can be used in your current designs.⚡️
Developers naturally love to create beautiful architectures that are ready to take on change from any direction.💙
If you have a practical need to support change in a design today, go ahead and employ a pattern it handle that change. ✅
However, if the reason is only hypothetical, don't add the pattern, it is only going to add complexity to your system, and you might never need it. ❌
〰〰〰〰〰〰
#DesignPatterns #Tips
@ProgrammingTip
Design Patterns are powerful, and it's easy to see all kinds of ways they can be used in your current designs.⚡️
Developers naturally love to create beautiful architectures that are ready to take on change from any direction.💙
If you have a practical need to support change in a design today, go ahead and employ a pattern it handle that change. ✅
However, if the reason is only hypothetical, don't add the pattern, it is only going to add complexity to your system, and you might never need it. ❌
〰〰〰〰〰〰
#DesignPatterns #Tips
@ProgrammingTip
14 Latest and Best 404 Error Page Designs for Webs/Mobile Apps ✨
A 404 error page, which often serves to alert web/app visitors that the page they are trying to reach does not exist, is often regarded as one of the most possible elements to lose users/visitors with boring and dull logging-in/out/loading/leading pages in a web/app. 🙄
However, that does not mean such error pages will be a nightmare in all cases. ❌
Actually, a creative, cool, interesting or informative 404 error page can not only lead customers to other parts of your websites/apps smoothly, but also reduce customer frustration and let them stay on the site/app much longer. 💎
Let’s keep reading this article and enjoy 14 latest and best 404 error page designs to get inspiration and learn how to make a beautiful, interesting and attractive 404 error not found page design. ⚡️
https://news.1rj.ru/str/pgimg/111
[ Article ] : https://goo.gl/A5mJjx
〰〰〰〰〰〰
#Design #UI #UX
@ProgrammingTip
A 404 error page, which often serves to alert web/app visitors that the page they are trying to reach does not exist, is often regarded as one of the most possible elements to lose users/visitors with boring and dull logging-in/out/loading/leading pages in a web/app. 🙄
However, that does not mean such error pages will be a nightmare in all cases. ❌
Actually, a creative, cool, interesting or informative 404 error page can not only lead customers to other parts of your websites/apps smoothly, but also reduce customer frustration and let them stay on the site/app much longer. 💎
Let’s keep reading this article and enjoy 14 latest and best 404 error page designs to get inspiration and learn how to make a beautiful, interesting and attractive 404 error not found page design. ⚡️
https://news.1rj.ru/str/pgimg/111
[ Article ] : https://goo.gl/A5mJjx
〰〰〰〰〰〰
#Design #UI #UX
@ProgrammingTip
Telegram
Programming Tips Resources
ASP.NET Core 2 – Global Model Validation ⚠️
We use a lot of repetitive code in our actions. ♻️
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVC’s base controller class :
The bad thing about is that we repeat this piece of code throughout a lot of our actions. ❌
How we can make it better❓
This article shows you how to validate ModelState with a global filter. 💎
https://news.1rj.ru/str/pgimg/112
[ Article ] : bit.do/mval
〰〰〰〰〰〰
#AspMvc #Core #Validation
@ProgrammingTip
We use a lot of repetitive code in our actions. ♻️
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVC’s base controller class :
if (!ModelState.IsValid)
return BadRequest(ModelState);
The bad thing about is that we repeat this piece of code throughout a lot of our actions. ❌
How we can make it better❓
This article shows you how to validate ModelState with a global filter. 💎
https://news.1rj.ru/str/pgimg/112
[ Article ] : bit.do/mval
〰〰〰〰〰〰
#AspMvc #Core #Validation
@ProgrammingTip
Telegram
Programming Tips Resources
Controller Lookup & Default Controller Factory 🏭
As the name, the Controller factory is the component responsible for searching and creating controllers.👷
Like many other components, ASP.NET MVC has a built-in factory named DefaultControllerFactory that's pretty much sufficient in most cases. 💎
Searching a controller is a perform intensive job and the DefaultControllerFactory does some efficient caching mechanism to avoid looking for controllers every time when there is a need. ✅
In this article we are going to explore how the DefaultControllerFactory searches for a controller and what kind of strategies it uses to do the process efficiently. ⚡️
https://news.1rj.ru/str/pgimg/113
[ Article ] : bit.do/cfac
〰〰〰〰〰〰
#AspMvc #Controller #Depth
@ProgrammingTip
As the name, the Controller factory is the component responsible for searching and creating controllers.👷
Like many other components, ASP.NET MVC has a built-in factory named DefaultControllerFactory that's pretty much sufficient in most cases. 💎
Searching a controller is a perform intensive job and the DefaultControllerFactory does some efficient caching mechanism to avoid looking for controllers every time when there is a need. ✅
In this article we are going to explore how the DefaultControllerFactory searches for a controller and what kind of strategies it uses to do the process efficiently. ⚡️
https://news.1rj.ru/str/pgimg/113
[ Article ] : bit.do/cfac
〰〰〰〰〰〰
#AspMvc #Controller #Depth
@ProgrammingTip
Telegram
Programming Tips Resources
Render Action & Render Partial.png
1 MB
Nancy wants to display the logged-in users in a partial view. 👤
She got confused whether to use RenderAction or RenderPartial.🧐
Mark clarifies her when to use what. ✅
〰〰〰〰〰
#AspMvc
@ProgrammingTip
She got confused whether to use RenderAction or RenderPartial.🧐
Mark clarifies her when to use what. ✅
〰〰〰〰〰
#AspMvc
@ProgrammingTip
Principle of Least Surprise 😳
Principle Statement :
In interface design, always do the least surprising thing. 😨
Denoscription :
Never surprise the user. ❌
An interface should behave exactly as the user thinks it behaves. ✅
What surprises the user depends on the kind of interface and the type of user. 🖥
The central idea of PLS is to think about how the user would want to use the interface. 🤳🏻
Principle of least astonishment is when you, as an API designer, prevent your users from saying WAT. 😱
🔸🔹🔸🔹
Examples :
1️⃣ Consider an elevator with a button next to it that says "call". ☎️
When you press the button, the payphone phone rings (rather than calling the elevator to that floor). ❌
The correct design would be to put the call button next to the phone rather than the elevator. ⛓
2️⃣ Think of a web page that has popup window that shows a windows style error with an 'ok' button on it. 🆗
People click the 'ok' button thinking it is for the operating system and instead go to another web page. 🌐
This astonishes the user. 😦
3️⃣ The name of a function should reflect what it does. Otherwise, a user of the function will be unpleasantly surprised❗️
Bad :
Better :
🔹🔸🔹🔸
When it comes to an API ... 👾
• Think about a toString() method that instead of printing out the fields returns back "to be implemented". 🤥
• An equals() method that works on hidden information. 👁
• Sometimes people try to implement a sorted list class by changing the add method to call sort() on the array afterwards. 🗂
This astonishing because the add method is supposed to append to the list. 🗳
This is especially astonishing when one gets back a List object with no knowledge that somewhere deep inside, someone violated the interface contract. 🤔
Having a method that does one distinct thing contributes to reduction of astonishment. ✅
https://news.1rj.ru/str/pgimg/115
〰〰〰〰〰〰
#Principle #PLS
@ProgrammingTip
Principle Statement :
In interface design, always do the least surprising thing. 😨
Denoscription :
Never surprise the user. ❌
An interface should behave exactly as the user thinks it behaves. ✅
What surprises the user depends on the kind of interface and the type of user. 🖥
The central idea of PLS is to think about how the user would want to use the interface. 🤳🏻
Principle of least astonishment is when you, as an API designer, prevent your users from saying WAT. 😱
🔸🔹🔸🔹
Examples :
1️⃣ Consider an elevator with a button next to it that says "call". ☎️
When you press the button, the payphone phone rings (rather than calling the elevator to that floor). ❌
The correct design would be to put the call button next to the phone rather than the elevator. ⛓
2️⃣ Think of a web page that has popup window that shows a windows style error with an 'ok' button on it. 🆗
People click the 'ok' button thinking it is for the operating system and instead go to another web page. 🌐
This astonishes the user. 😦
3️⃣ The name of a function should reflect what it does. Otherwise, a user of the function will be unpleasantly surprised❗️
Bad :
int multiply(int a, int b)
{
return a + b;
}
Better :
int multiply(int a, int b)
{
return a * b;
}
🔹🔸🔹🔸
When it comes to an API ... 👾
• Think about a toString() method that instead of printing out the fields returns back "to be implemented". 🤥
• An equals() method that works on hidden information. 👁
• Sometimes people try to implement a sorted list class by changing the add method to call sort() on the array afterwards. 🗂
This astonishing because the add method is supposed to append to the list. 🗳
This is especially astonishing when one gets back a List object with no knowledge that somewhere deep inside, someone violated the interface contract. 🤔
Having a method that does one distinct thing contributes to reduction of astonishment. ✅
https://news.1rj.ru/str/pgimg/115
〰〰〰〰〰〰
#Principle #PLS
@ProgrammingTip
Telegram
Programming Tips Resources
Nivo ✨
Provides supercharged React components to easily build dataviz apps, it's built on top of d3. ⚛️
Several libraries already exist for React d3 integration, but just a few provide server side rendering ability and fully declarative charts. 💎
Features :
🔸 Highly customizable
🔹 Motion/transitions
🔸 Component playground
🔹 Exhaustive documentation
🔸 Isomorphic rendering
🔹 SVG charts
🔸 HTML charts
🔹 Canvas charts
🔸 Server side rendering API
🔹 Gradients
🔸 Responsive charts
https://news.1rj.ru/str/pgimg/116
[ Source ] : github.com/plouc/nivo
[ Document & Website ] : nivo.rocks
〰〰〰〰〰〰
#React #Chart #Calendar
#Treemap #JavaScript
@ProgrammingTip
Provides supercharged React components to easily build dataviz apps, it's built on top of d3. ⚛️
Several libraries already exist for React d3 integration, but just a few provide server side rendering ability and fully declarative charts. 💎
Features :
🔸 Highly customizable
🔹 Motion/transitions
🔸 Component playground
🔹 Exhaustive documentation
🔸 Isomorphic rendering
🔹 SVG charts
🔸 HTML charts
🔹 Canvas charts
🔸 Server side rendering API
🔹 Gradients
🔸 Responsive charts
https://news.1rj.ru/str/pgimg/116
[ Source ] : github.com/plouc/nivo
[ Document & Website ] : nivo.rocks
〰〰〰〰〰〰
#React #Chart #Calendar
#Treemap #JavaScript
@ProgrammingTip
Telegram
Programming Tips Resources
Use DbContextPooling to Improve the Performance : .NET Core 2.1 Feature 💎
If you are familiar with .NET Core, then you might be knowing AddDbContext method. 🧐
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. 💉
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. ♻️
New contexts are getting created for each request. ⏳
That is still fine but if there are more than 1k requests – 1k times object will be created and disposed, unless you have made it a Singleton. ☝🏻
Creating and disposing of so many objects may impact the performance. ❌
How DbContextPooling can help❓
https://news.1rj.ru/str/pgimg/117
[ Article ] : http://bit.do/dbpol
〰〰〰〰〰〰
#AspMvc #Core
@ProgrammingTip
If you are familiar with .NET Core, then you might be knowing AddDbContext method. 🧐
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. 💉
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. ♻️
New contexts are getting created for each request. ⏳
That is still fine but if there are more than 1k requests – 1k times object will be created and disposed, unless you have made it a Singleton. ☝🏻
Creating and disposing of so many objects may impact the performance. ❌
How DbContextPooling can help❓
https://news.1rj.ru/str/pgimg/117
[ Article ] : http://bit.do/dbpol
〰〰〰〰〰〰
#AspMvc #Core
@ProgrammingTip
Telegram
Programming Tips Resources
Using MariaDB with ASP.NET Core 2.0 🌊
What is MariaDB❓
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. 🐧
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. 💎
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. ✨
So let’s put this to the test with a simple ASP.NET Core application. 🔥
https://news.1rj.ru/str/pgimg/118
[ Article ] : bit.do/mariad
〰〰〰〰〰〰
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
What is MariaDB❓
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. 🐧
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. 💎
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. ✨
So let’s put this to the test with a simple ASP.NET Core application. 🔥
https://news.1rj.ru/str/pgimg/118
[ Article ] : bit.do/mariad
〰〰〰〰〰〰
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
Telegram
Programming Tips Resources
18 Interesting Things from jQuery ✨
jQuery is one of the most popular JavaScript libraries in use today. 💎
It is the library that is beloved by most of the web developers for noscripting. 👾
In this article I'm going to share you some of the interesting things from that library. 🔥
https://news.1rj.ru/str/pgimg/119
[ Article ] : bit.do/jqint
〰〰〰〰〰〰
#JavaScript #jQuery
@ProgrammingTip
jQuery is one of the most popular JavaScript libraries in use today. 💎
It is the library that is beloved by most of the web developers for noscripting. 👾
In this article I'm going to share you some of the interesting things from that library. 🔥
https://news.1rj.ru/str/pgimg/119
[ Article ] : bit.do/jqint
〰〰〰〰〰〰
#JavaScript #jQuery
@ProgrammingTip
Telegram
Programming Tips Resources
Blazor 🔥
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. 💎
Blazor is a .NET web framework that runs in any browser. 🌐
Blazor uses only the latest web standards. No plugins or transpilation needed. ✅
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. ⚡️
It works in older browsers too by falling back to an asm.js based .NET runtime. 👴🏿
Blazor will have all the features of a modern web framework, including ✨ :
• Components
• Routing
• Layouts
• Forms and validation
• Dependency injection
• JavaScript interop
• Live reloading
• Server-side rendering
• Full .NET debugging
https://news.1rj.ru/str/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
〰〰〰〰〰〰
#Blazor #AspMvc #Core
@ProgammingTip
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. 💎
Blazor is a .NET web framework that runs in any browser. 🌐
Blazor uses only the latest web standards. No plugins or transpilation needed. ✅
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. ⚡️
It works in older browsers too by falling back to an asm.js based .NET runtime. 👴🏿
Blazor will have all the features of a modern web framework, including ✨ :
• Components
• Routing
• Layouts
• Forms and validation
• Dependency injection
• JavaScript interop
• Live reloading
• Server-side rendering
• Full .NET debugging
https://news.1rj.ru/str/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
〰〰〰〰〰〰
#Blazor #AspMvc #Core
@ProgammingTip
Telegram
Programming Tips Resources
Avoid Lazy Loading Entities in ASP.NET Applications 🙅🏻♂️
Lazy Loading is an Entity Framework feature that lets you worry less about the specific amount of data you need to fetch with a given query. 😌
Instead, you write simple queries, and Entity Framework will load the minimal amount of data (which is a good thing), and then will only fetch additional data on an as-needed basis. ✅
That is, rather than eager loading all of the related data a given entity might have, lazy loading is a technique that has EF perform the minimal amount of work needed up front, and then only performs additional work if it turns out to be necessary. ⚠️
This sounds like a great feature, but you should turn it off in your ASP.NET web apps. 🚫
This article explains why you should do this. 🧐
https://news.1rj.ru/str/pgimg/121
[ Article ] : bit.do/lazyy
〰〰〰〰〰〰
#AspMvc #LazyLoading
@ProgrammingTip
Lazy Loading is an Entity Framework feature that lets you worry less about the specific amount of data you need to fetch with a given query. 😌
Instead, you write simple queries, and Entity Framework will load the minimal amount of data (which is a good thing), and then will only fetch additional data on an as-needed basis. ✅
That is, rather than eager loading all of the related data a given entity might have, lazy loading is a technique that has EF perform the minimal amount of work needed up front, and then only performs additional work if it turns out to be necessary. ⚠️
This sounds like a great feature, but you should turn it off in your ASP.NET web apps. 🚫
This article explains why you should do this. 🧐
https://news.1rj.ru/str/pgimg/121
[ Article ] : bit.do/lazyy
〰〰〰〰〰〰
#AspMvc #LazyLoading
@ProgrammingTip
Telegram
Programming Tips Resources
Ngrok 🔥
Ngrok allows you to expose a web server running on your local machine to the internet. 🌐
Just tell ngrok what port your web server is listening on :👂🏻
Result ✅ :
You can now access your website from ✨ :
http://92832de0.ngrok.io
When you start ngrok, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel 🛠.
Inspecting Your Traffic 📊
Ngrok provides a real-time web UI where you can introspect all of the HTTP traffic running over your tunnels. 👀
After you've started ngrok, just open http://localhost:4040 in a web browser to inspect request details. 🌀
https://news.1rj.ru/str/pgimg/122
[ Docs ] : ngrok.com/docs
〰〰〰〰〰〰
#Ngrok #Testing
@ProgrammingTip
Ngrok allows you to expose a web server running on your local machine to the internet. 🌐
Just tell ngrok what port your web server is listening on :👂🏻
ngrok http [port] -host-header="localhost:[port]"
Result ✅ :
Tunnel Status : online
Version : 2.0/2.0
Web Interface : 127.0.0.1:4040
Forwarding : http://92832de0.ngrok.io
Forwarding : https://92832de0.ngrok.io
You can now access your website from ✨ :
http://92832de0.ngrok.io
When you start ngrok, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel 🛠.
Inspecting Your Traffic 📊
Ngrok provides a real-time web UI where you can introspect all of the HTTP traffic running over your tunnels. 👀
After you've started ngrok, just open http://localhost:4040 in a web browser to inspect request details. 🌀
https://news.1rj.ru/str/pgimg/122
[ Docs ] : ngrok.com/docs
〰〰〰〰〰〰
#Ngrok #Testing
@ProgrammingTip
Telegram
Programming Tips Resources
A shorter and URL friendly GUID ✨
This a small helper class in C#. 👾
The class encodes a GUID into a 22 character long string and decodes the string back to the original GUID again. ✅
It takes a standard GUID like this 🔬 :
And converts it into this smaller string 💎 :
It basically just converts a GUID into a base64 string and shortens it a bit. ⚡️
https://news.1rj.ru/str/pgimg/123
[ Article ] : bit.do/guids
〰〰〰〰〰〰
#CSharp #GUID
@ProgrammingTip
This a small helper class in C#. 👾
The class encodes a GUID into a 22 character long string and decodes the string back to the original GUID again. ✅
It takes a standard GUID like this 🔬 :
c9a646d3-9c61-4cb7-bfcd-ee2522c8f633
And converts it into this smaller string 💎 :
00amyWGct0y_ze4lIsj2Mw
It basically just converts a GUID into a base64 string and shortens it a bit. ⚡️
https://news.1rj.ru/str/pgimg/123
[ Article ] : bit.do/guids
〰〰〰〰〰〰
#CSharp #GUID
@ProgrammingTip
Telegram
Programming Tips Resources
Programming Tips 💡
Photo
ASP.NET Core.2 & Angular 5.pdf
7.3 MB
API Feature Folders ⚡️
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. 🗂
You don’t need to inherit from a different base type or anything like that. ❌
What’s more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. ↔️
What I’ve found to be a better organization is to do away with the Controllers folder (or keep it around if you’re using view-based controllers) and instead use feature folders for your APIs. 💎
I’m partial to having a root level API folder but if you’d prefer to put your features in the root of the project that would work, too. 👍🏻
Within each feature folder, you include the controller along with any model types it needs to work with, like this 👾 :
https://news.1rj.ru/str/pgimg/124
Obviously one benefit of this approach is that it’s more cohesive. ✅
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. ✂️
Another nice thing about this approach is that it just works. Unlike view-based controllers, you don’t need to change anything about how ASP.NET Core is configured to have this organization structure work for you. ✨
[ Article ] : bit.do/apif
〰〰〰〰〰〰
#AspMvc #Core #API
@ProgrammingTip
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. 🗂
You don’t need to inherit from a different base type or anything like that. ❌
What’s more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. ↔️
What I’ve found to be a better organization is to do away with the Controllers folder (or keep it around if you’re using view-based controllers) and instead use feature folders for your APIs. 💎
I’m partial to having a root level API folder but if you’d prefer to put your features in the root of the project that would work, too. 👍🏻
Within each feature folder, you include the controller along with any model types it needs to work with, like this 👾 :
https://news.1rj.ru/str/pgimg/124
Obviously one benefit of this approach is that it’s more cohesive. ✅
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. ✂️
Another nice thing about this approach is that it just works. Unlike view-based controllers, you don’t need to change anything about how ASP.NET Core is configured to have this organization structure work for you. ✨
[ Article ] : bit.do/apif
〰〰〰〰〰〰
#AspMvc #Core #API
@ProgrammingTip
Telegram
Programming Tips Resources