Programming Tips πŸ’‘
54.3K subscribers
66 photos
8 videos
30 files
339 links
Programming:
Tips πŸ’‘
Articles πŸ“•
Resources πŸ‘Ύ
Design Patterns πŸ’Ž
Software Principles βœ…

πŸ‡³πŸ‡± Contact & Ads: @MoienTajik
Download Telegram
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://t.me/pgimg/90

[ Website ] : https://stateofjs.com

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #Analytics
@ProgrammingTip
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://t.me/pgimg/91

[ Website ] : http://bit.do/mvvm

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #CleanCode #BestPractices
@ProgrammingTip
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://t.me/pgimg/92

[ Article ] : http://bit.do/aspzip

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Compression
@ProgrammingTip
ASP.NET MVC Best Practices and Guidelines βœ…

While most developers were used to WebForms and Microsoft's stock controls, when developers moved to ASP.NET MVC, a number of developers were shocked because there wasn't enough meat for this to be a full-featured release. πŸ€“

Some of the guidelines list below are based on my own experiences over the years since 2008. πŸ“†

https://t.me/pgimg/93

[ Website ] : http://bit.do/aspbst

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #CleanCode #BestPractices
@ProgrammingTip
Auth0: Introduction and Initial ASP.NET MVC Project Setup πŸš€

The big selling points for Auth0, and other services like it, are that it removes you from having to worry about Auth/User Management and get to the part of your applications that bring value to your customers. πŸ‘₯

As with Identity Server, Auth0 can use OpenID Connect (as well as a lot of other protocols), single sign-on and API Access Control. βœ…

https://t.me/pgimg/94

[ Article ] : http://bit.do/auas

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Auth0 #Authentication
@ProgrammingTip
Google it πŸ˜‚πŸ€¦β€β™‚οΈ

γ€°γ€°γ€°γ€°γ€°γ€°
#Fun
@ProgrammingTip
Architecting Services with Design Patterns πŸ’Ž

As the number of your services expands you're going to need to start thinking about how to organize them. πŸ—‚

Applying these two design patterns can help, provided you understand all their variations. βœ…

With the current set of tools that come with the Microsoft .NET Framework, it's easy to create a service. βš™οΈ

But it's also easy to create what both Nayaki Nayyar and Benjamin Moreland described as a "junk drawer of services." πŸ‘Ύ

If you're going to avoid that as the number of services in your organization increases, then you need to think about your architecture. πŸ€”

https://t.me/pgimg/95

[ Article ] : http://bit.do/asdp

γ€°γ€°γ€°γ€°γ€°γ€°
#CleanCode #DesignPatterns
@ProgrammingTip
5 More C# Extension Methods for the Stocking βž• A Bonus Method For Enums ! πŸ’₯


1️⃣ ToInt() βž–
We always have the familiar .ToString(), but what happens when we want to convert a simple string to an integer❓

πŸ”ΉπŸ”ΈπŸ”Ή

2️⃣ OrdinalSuffix() βž–
This extension method places a 'th', 'st', 'nd', 'rd', or 'th' to the end of the number. πŸ”š

πŸ”ΈπŸ”ΉπŸ”Έ

3️⃣ Occurrence() βž–
This just counts the number of occurrences in a string. πŸ”

πŸ”ΉπŸ”ΈπŸ”Ή

4️⃣ Join<T>()/Join() βž–
With this extension method, you can take an array or List<string>() and make a comma-delimited list in no time or build a broken-up URL with dashes as the URL name. βœ…

πŸ”ΈπŸ”ΉπŸ”Έ

5️⃣ ToQueryString() βž–
Have you ever wanted to take a NameValueCollection and convert it into a query string for a URL ? 🌐

πŸ”ΉπŸ”ΈπŸ”Ή

⚑️ Enums.ToList<T>() - Bonus Method βž–

This Enums.ToList<T> static method is meant to take enumerations with description attributes and convert them into a NameValueCollection for possibly a dropdown. πŸ“œ

πŸ”ΈπŸ”ΉπŸ”Έ

https://t.me/pgimg/96

[ Article ] : http://bit.do/chex

γ€°γ€°γ€°γ€°γ€°γ€°
#CSharp #ExtensionMethod
@ProgrammingTip
JavaScript β€” Null vs. Undefined ⚑️

Learn the differences and similarities between null and undefined in JavaScript. ⁉️

At first glance, null and undefined may seem the same, but they are far from it. ↔️

This article will explore the differences and similarities between null and undefined in JavaScript. βœ…

https://t.me/pgimg/97

[ Article ] : http://bit.do/nullu

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #Null
@ProgrammingTip
Use T4MVC to Remove Magic Strings in ASP.NET MVC Apps 🎩

ASP.NET MVC has a fascination with magic strings. ❌

Basically any time you need to specify an action, a view, or controller, you use a magic string ✨ :

return RedirectToAction("Index", "Home", new { id = 4 });

return View("Details");

@Html.ActionLink("Back to details", "Detals", "User", new {id = 12}, new {@class = "backlink"});

@using (Html.BeginForm("Details", "User", FormMethod.Post))


The problem with magic strings is the same problem that ViewBag has ⚠️ :

1️⃣ There's no type checking.

2️⃣ The developer won't catch these errors until runtime, and sometimes not at all.

πŸ”ΉπŸ”ΈπŸ”ΉπŸ”Έ

T4MVC aims to remove magic strings from MVC and replace them with strongly-typed ActionResults. βœ…

It adds a bunch more overloads to methods such as ActionLink(), BeginForm(), and RedirectToAction() so that they can now accept ActionResults as parameters. πŸ—ƒ

Thereby making them strongly-typed and removing their dependency on magic strings. πŸ’Ž

Most importantly, it means we can take the above code samples and refactor them to look like this πŸ€™πŸ» :

return RedirectToAction(MVC.Home.Index(4));

return View(MVC.User.Views.ViewNames.Details);

@Html.ActionLink("Back to details", MVC.User.Details(12), new {@class = "backlink"});

@using (Html.BeginForm(MVC.User.Details(), FormMethod.Post))



https://t.me/pgimg/98

[ Article ] : http://bit.do/t4mvc

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #CleanCode #T4MVC
@ProgrammingTip
Q&A: Successful Developer Career Strategies πŸ’Ž

The field of computer science is huge, far too wide for anyone to master in all areas. 🌍

We all need to make difficult choices about how and where we spend our time. ⏰

It’s often said that in order to be successful in this industry you need to specialize. πŸ€“

But it’s also often said that you need a wide range of experience. βœ…

So what is more important : breadth or depth ⁉️

This is a very difficult question, and is why I asked for the advice of some of the very brightest minds in our industry. πŸ‘‘

Our expert panel is comprised of the following seven developers πŸ‘₯ :

β€’ Scott Allen
β€’ Mark Seemann
β€’ Julie Lerman
β€’ Kyle Simpson
β€’ Troy Hunt
β€’ Oren Eini
β€’ Cory House

https://t.me/pgimg/99

[ Article ] : http://bit.do/qadev

γ€°γ€°γ€°γ€°γ€°γ€°
#QA #Strategy
@ProgrammingTip
ASP.NET Core Interview Questions πŸ’Ό

This post is about ASP.NET Core Interview Questions. ⁉️

These questions are directly tied to ASP.NET Core. βœ…

They are not meant to serve as only questions that you would ask a candidate during an interview. ❌

Use these to assess if the candidate has any knowledge about ASP.NET Core. πŸ‘“

The questions should serve as guidelines for core ASP.NET Core concepts that candidate should be familiar with. πŸ‘ͺ

https://t.me/pgimg/100

[ Article ] : http://bit.do/aspint

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #AspCore #Core #Interview
@ProgrammingTip
Generating Friendly URLs in ASP.NET MVC πŸ¦„

Have a look at the following URL πŸ‘€ :

http://www.amazon.com/gp/product/1617292397/ref=s9_psimh_gw_p14_d4_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=0TFM5Q6WM6KD9NPNG9G7&pf_rd_t=36701&pf_rd_p=2079475242&pf_rd_i=desktop


Do you have any idea what the URL is pointing to by just looking at it❓Most likely not.

Now look at this one πŸ’Ž :

http://www.dpreview.com/articles/9485436827/the-big-beast-hands-on-with-the-panasonic-lumix-dmc-gx8


Any idea❓Well it would seem that it is an article about a hands-on with the Panasonic Lumix DMX-GX8. πŸ–₯

In today’s blog post I would like to demonstrate how to generate β€œfriendly URLs” in your ASP.NET applications. βœ…

Friendly not just in the sense that someone can look at it and figure out what the URL is pointing to, but more importantly friendly for search engines. 🌐

https://t.me/pgimg/101

[ Article ] : http://bit.do/aspseo

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #SEO
@ProgrammingTip
Fasify.io ⚑️

An efficient server implies a lower cost of the infrastructure, a better responsiveness under load and happy users. πŸ€“

How can you efficiently handle the resources of your server, knowing that you are serving the highest number of requests as possible, without sacrificing security validations and handy development ⁉️

Enter Fastify. Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we know, it is one of the fastest web frameworks in town. πŸ”₯

Install πŸ“₯
npm install fastify --save


πŸ”ΉπŸ”ΈπŸ”ΉπŸ”Έ


[ Example ]

// Require the framework and instantiate it
const fastify = require("fastify") ()

// Declare a route
fastify.get("/", function (request, reply) {
reply.send({ hello: "world" })
})

fastify.listen(3000, function (err) {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})


πŸ”ΉπŸ”ΈπŸ”ΉπŸ”Έ


[ Async-Example ]

const fastify = require('fastify')()

fastify.get('/', async (request, reply) => {
reply.type('application/json').code(200)
return { hello: 'world' }
})

fastify.listen(3000, function (err) {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})


https://t.me/pgimg/102


[ Website ] : https://www.fastify.io

γ€°γ€°γ€°γ€°γ€°γ€°
#JavaScript #NPM #Fastify
@ProgrammingTip
Anatomy of an ASP.NET Identity PasswordHash πŸ”

Have you ever looked at a user record in an ASP.NET Identity’s users table and wondered just what is being saved on the PasswordHash column❓

It looks like this (it’s in base64) :
AQAAAAEAACcQAAAAEJSPbbFM1aeXB8fGRV7RRamLpjzktAF7FjwDWtFx35eol4AxN6vm4zWR9EApc7WPsQ


Apart from maybe satisfying your curiosity, what could you benefit from knowing exactly what’s on that seemingly random sequence of characters❓

Well, you could confidently update from different versions of ASP.NET Identity. πŸŒ€

Also, if you ever get tired of ASP.NET Identity for whatever reason, you could move your user accounts to whatever alternative you found that might be better. βœ…

Or, you just want to have a simple users’ table and not have to deal with all of what you need to know to make ASP.NET Identity work. πŸ‘₯

All of this while still being able to move your user accounts to ASP.NET Identity some day if you choose to do so. ♻️

https://t.me/pgimg/103

[ Article ] : http://bit.do/aspidn

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Identity
@ProgrammingTip
The Clean Coder.pdf
2.8 MB
The Clean Coder : A Code of Conduct for Professional ProgrammersπŸ“•

Author : Robert C. Martin πŸ–Š

Level : Advanced πŸ’Ž

γ€°γ€°γ€°γ€°γ€°γ€°
#Book #CleanCode
@ProgrammingTip
Mocky πŸ€–

Mock your HTTP responses to test your REST API. πŸ‘Ύ

Mocky is a simple app which allows to generate custom HTTP responses. 🌐

It's helpful when you have to request a build-in-progress WS, when you want to mock the backend response in a singleapp, or when you want to test your WS client. βœ…

Is Mocky online❓
Yes, Mocky is online, free and unlimited. πŸ’Έ

https://t.me/pgimg/104

[ Website ] : mocky.io

γ€°γ€°γ€°γ€°γ€°γ€°
#Mock #Rest
@ProgrammingTip
NopCommerce ID-Less URL Structure Demystified πŸ’Ž

The link for my NopLite - nopCommerce Responsive Theme is ✨ :
http://www.pronopcommerce.com/noplite-nopcommerce-responsive-theme


You don't see ANY integer in the URL, but nopCommerce somehow knows how to map from the URL to the appropriate ID. βœ…

On the other hand, the nopCommerce 2.65 URL for my NopLite theme would have been πŸ‘ŽπŸ» :
http://www.pronopcommerce.com/p/7/noplite-nopcommerce-responsive-theme


Note the '7' somewhere in between the URL, that's the Integer Product ID. πŸ—ƒ

So the question is, how does nopCommerce 2.70 and 2.80 know the ID without looking the ID❓

https://t.me/pgimg/105

[ Article ] : http://bit.do/nopu

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Routing #NopCommerce
@ProgrammingTip
Pretty Checkbox 🌈

A pure CSS library to beautify checkbox and radio buttons. ✨

Framework Compatability πŸ”₯ :
β€’ Angular
β€’ Bootstrap
β€’ React
β€’ Vue

https://t.me/pgimg/106

[ Website ] : http://bit.do/csspr

γ€°γ€°γ€°γ€°γ€°γ€°
#CSS #Library
@ProgrammingTip
HTTP codes as Valentine’s Day comics πŸ’™

With Valentine’s Day around the corner, it is a time for romantic hopefuls to ask out the object of their affection, and await an answer. 🀠

It could be a simple β€œyes,” a sad β€œno,” or a cryptic β€œI don’t think about you that way, but maybe we can grab a coffee tomorrow❓”

Which brings us to HTTP (Hypertext Transfer Protocol) codes. 🌐

When a URL is typed in a browser, a request is sent out to the server and the browser awaits an answer, just like in our scenario. ♻️

These answers come in the form of an HTTP code, which is a three-digit number that maps to an answer. 2️⃣0️⃣0️⃣

With the image of Valentine’s Day in mind, here are a few likely scenarios. πŸ˜†β€οΈ

https://t.me/pgimg/107

[ Article ] : http://bit.do/httpval

γ€°γ€°γ€°γ€°γ€°γ€°
#HTTP #Valentine #Fun
@ProgrammingTip