Mocking objects with Moq and XUnit in .NET Core πΎ
This article explains the step by step process that needed to Moq an object in .NET Core βοΈ
Mocking objects comes in handy when unit testing data store, where a Database can be mocked so that no data is added or modified in Database while unit testing source code. β»οΈ
https://t.me/pgimg/32
[ Tutorial ] : http://bit.do/moqx
γ°γ°γ°γ°γ°γ°
#UnitTest #Mocking #XUnit #Moq
@ProgrammingTip
This article explains the step by step process that needed to Moq an object in .NET Core βοΈ
Mocking objects comes in handy when unit testing data store, where a Database can be mocked so that no data is added or modified in Database while unit testing source code. β»οΈ
https://t.me/pgimg/32
[ Tutorial ] : http://bit.do/moqx
γ°γ°γ°γ°γ°γ°
#UnitTest #Mocking #XUnit #Moq
@ProgrammingTip
Telegram
Programming Tips Resources
Webpack π
Webpack is a module bundler. π
Its main purpose is to bundle JavaScript files for usage in a browser, it is also capable of transforming, bundling, or packaging. π
[ Website ] : https://webpack.js.org/
https://t.me/pgimg/34
γ°γ°γ°γ°γ°γ°
#Webpack #Bundler
@ProgrammingTip
Webpack is a module bundler. π
Its main purpose is to bundle JavaScript files for usage in a browser, it is also capable of transforming, bundling, or packaging. π
[ Website ] : https://webpack.js.org/
https://t.me/pgimg/34
γ°γ°γ°γ°γ°γ°
#Webpack #Bundler
@ProgrammingTip
Telegram
Programming Tips Resources
Explicit Dependencies Principle β¨
Classes should be honest about what they need to be created. π£
Methods and classes should explicitly require any collaborating objects they need { typically through method parameters or constructor parameters } in order to function correctly. β
[ Article ] : http://bit.do/expp
https://t.me/pgimg/35
γ°γ°γ°γ°γ°γ°
#Principle
@ProgrammingTip
Classes should be honest about what they need to be created. π£
Methods and classes should explicitly require any collaborating objects they need { typically through method parameters or constructor parameters } in order to function correctly. β
[ Article ] : http://bit.do/expp
https://t.me/pgimg/35
γ°γ°γ°γ°γ°γ°
#Principle
@ProgrammingTip
Telegram
Programming Tips Resources
CSS Variables β What You Need to Know π¨
CSS variables are more accurately described as custom properties.
They are useful in preventing DRY β Donβt Repeat Yourself code.
With the ability to change a property once and have that change made all over your style sheet is magical βοΈ
[ Article ] : http://bit.do/cvar
γ°γ°γ°γ°γ°γ°
#CSS #Variable
@ProgrammingTip
CSS variables are more accurately described as custom properties.
They are useful in preventing DRY β Donβt Repeat Yourself code.
With the ability to change a property once and have that change made all over your style sheet is magical βοΈ
[ Article ] : http://bit.do/cvar
γ°γ°γ°γ°γ°γ°
#CSS #Variable
@ProgrammingTip
codeburst
CSS VariablesβββWhat You Need to Know.
One week down, nine to goβ¦ Closing week 1 of coding bootcamp I had to present at Hacker Youβs weekly Show-and-Tell mixer.
Hashids πΎ
Hashids is a small open-source library that generates short, unique, non-sequential ids from numbers. π
It converts numbers like 347 into strings like βyr8β, or array of numbers like [27, 986] into β3kTMdβ. π
You can also decode those ids back. π
Available in π₯ :
β’ JavaScript
β’ .NET
β’ Java
β’ PHP
β’ Ruby
β’ Python
β’ Swift
β’ ...
πΈπΉπΈπΉ
Usage example in JavaScript π€π» :
https://t.me/pgimg/36
[ Website ] : http://hashids.org/
γ°γ°γ°γ°γ°γ°
#Encode #Hash
@ProgrammingTip
Hashids is a small open-source library that generates short, unique, non-sequential ids from numbers. π
It converts numbers like 347 into strings like βyr8β, or array of numbers like [27, 986] into β3kTMdβ. π
You can also decode those ids back. π
Available in π₯ :
β’ JavaScript
β’ .NET
β’ Java
β’ PHP
β’ Ruby
β’ Python
β’ Swift
β’ ...
πΈπΉπΈπΉ
Usage example in JavaScript π€π» :
var hashids = new Hashids("this is my salt", 8, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");
var id = hashids.encode(1, 2, 3);
// Output : GlaHquq0
var numbers = hashids.decode(id);
// Output : [1, 2, 3]https://t.me/pgimg/36
[ Website ] : http://hashids.org/
γ°γ°γ°γ°γ°γ°
#Encode #Hash
@ProgrammingTip
Telegram
Programming Tips Resources
The Art of Comments π¨
[ Article ] : https://css-tricks.com/the-art-of-comments/
γ°γ°γ°γ°γ°γ°
#CleanCode #Comments
@ProgrammingTip
[ Article ] : https://css-tricks.com/the-art-of-comments/
γ°γ°γ°γ°γ°γ°
#CleanCode #Comments
@ProgrammingTip
Deploy ASP.NET Core 2.0 Apps on Heroku βοΈ
In this tutorial, weβll be taking a look at how to deploy web apps built with asp.net core 2.0 to heroku.com, a cloud-hosting platform.
Weβll need a few things π :
β’ Docker (Windows, Mac)
β’ Heroku CLI (NPM, Binaries)
β’ ASP.NET Core 2.0 Runtime
https://t.me/pgimg/37
[ Tutorial ] : http://bit.do/aspheroku
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Heroku
@ProgrammingTip
In this tutorial, weβll be taking a look at how to deploy web apps built with asp.net core 2.0 to heroku.com, a cloud-hosting platform.
Weβll need a few things π :
β’ Docker (Windows, Mac)
β’ Heroku CLI (NPM, Binaries)
β’ ASP.NET Core 2.0 Runtime
https://t.me/pgimg/37
[ Tutorial ] : http://bit.do/aspheroku
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Heroku
@ProgrammingTip
Telegram
Programming Tips Resources
WAVE β¨
WAVE is tool to help web developers make their web content more accessible. β
WAVE cannot tell you if your web content is accessible. β
Only a human can determine true accessibility. π₯
But, WAVE can help you evaluate the accessibility of your web content. π
https://t.me/pgimg/38
[ Website ] : http://wave.webaim.org
γ°γ°γ°γ°γ°γ°γ°γ°γ°γ°γ°
#FrontEnd #Web #Tools
@ProgrammingTip
WAVE is tool to help web developers make their web content more accessible. β
WAVE cannot tell you if your web content is accessible. β
Only a human can determine true accessibility. π₯
But, WAVE can help you evaluate the accessibility of your web content. π
https://t.me/pgimg/38
[ Website ] : http://wave.webaim.org
γ°γ°γ°γ°γ°γ°γ°γ°γ°γ°γ°
#FrontEnd #Web #Tools
@ProgrammingTip
Telegram
Programming Tips Resources
Enjoy CSS π»
Online CSS3 Code Generator With a Simple Graphical Interface. π€
[ Website ] : http://enjoycss.com
γ°γ°γ°γ°γ°γ°
#FrontEnd #Css
@ProgrammingTip
Online CSS3 Code Generator With a Simple Graphical Interface. π€
[ Website ] : http://enjoycss.com
γ°γ°γ°γ°γ°γ°
#FrontEnd #Css
@ProgrammingTip
Hollywood Principle β¨
Relevant when you are writing a class/component that must fit into the constraints of an existing framework.
You implement the interfaces, you get registered. π€
You get called when the time is right. π
πΉπΈπΉπΈ
By way of an example, a typical ASP.NET Web Form might have in its codebehind page event handlers to respond to Page_Load and Button_Click events. β‘οΈ
An ASP.NET developer writes code to respond to these external framework events, instead of owning the execution of the web server and making all decisions and method calls accordingly. β
[ Article ] : http://bit.do/holprin
https://t.me/pgimg/39
γ°γ°γ°γ°γ°γ°
#Principle
@ProgrammingTip
"Don't call us, we'll call you" βοΈ
Relevant when you are writing a class/component that must fit into the constraints of an existing framework.
You implement the interfaces, you get registered. π€
You get called when the time is right. π
πΉπΈπΉπΈ
By way of an example, a typical ASP.NET Web Form might have in its codebehind page event handlers to respond to Page_Load and Button_Click events. β‘οΈ
An ASP.NET developer writes code to respond to these external framework events, instead of owning the execution of the web server and making all decisions and method calls accordingly. β
[ Article ] : http://bit.do/holprin
https://t.me/pgimg/39
γ°γ°γ°γ°γ°γ°
#Principle
@ProgrammingTip
Telegram
Programming Tips Resources
Jade-Lang π°
Jade is a high performance template engine heavily influenced by Haml and implemented with JavaScript for node and browsers. π
Syntax :
Becomes :
Options β¨ :
πΈ Compile Debug - If set to true, the function source will be included in the compiled template for better error messages.
πΉ Add pretty-indentation whitespace to output
https://t.me/pgimg/40
[ Website ] : http://jade-lang.com
[ Npm Package ] : https://www.npmjs.com/package/jade
γ°γ°γ°γ°γ°γ°
#Node #JavaScript #Jade
@ProgrammingTip
Jade is a high performance template engine heavily influenced by Haml and implemented with JavaScript for node and browsers. π
Syntax :
doctype html
html(lang="en")
head
title= pageTitle
script(type='text/javascript').
if (foo) bar(1 + 5)
body
h1 Jade - node template engine
#container.col
if youAreUsingJade
p You are amazing
else
p Get on it!
Becomes :
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jade</title>
<script type="text/javascript">
if (foo) bar(1 + 5)
</script>
</head>
<body>
<h1>Jade - node template engine</h1>
<div id="container" class="col">
<p>You are amazing</p>
</div>
</body>
</html>
Options β¨ :
πΈ Compile Debug - If set to true, the function source will be included in the compiled template for better error messages.
πΉ Add pretty-indentation whitespace to output
https://t.me/pgimg/40
[ Website ] : http://jade-lang.com
[ Npm Package ] : https://www.npmjs.com/package/jade
γ°γ°γ°γ°γ°γ°
#Node #JavaScript #Jade
@ProgrammingTip
Telegram
Programming Tips Resources
Open Graph Protocol π
The Open Graph protocol enables any web page to become a rich object in a social graph. π
For instance, this is used on Facebook to allow any web page to have the same functionality as any other object on Facebook.
Also, Telegram uses this protocol to preview web pages like a rich object in messages and you can update your links preview using : @WebPageBot β
To turn your web pages into graph objects, you need to add basic metadata to your page βπ» :
πΉπΈπΉπΈ
As an example, the following is the Open Graph protocol markup for The Rock on IMDB π₯ :
https://t.me/pgimg/41
[ Website ] : http://ogp.me/
γ°γ°γ°γ°γ°γ°
#OpenGraph #Protocol
@ProgrammingTip
The Open Graph protocol enables any web page to become a rich object in a social graph. π
For instance, this is used on Facebook to allow any web page to have the same functionality as any other object on Facebook.
Also, Telegram uses this protocol to preview web pages like a rich object in messages and you can update your links preview using : @WebPageBot β
To turn your web pages into graph objects, you need to add basic metadata to your page βπ» :
og:title
og:type
og:image
og:url
πΉπΈπΉπΈ
As an example, the following is the Open Graph protocol markup for The Rock on IMDB π₯ :
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
</head>
https://t.me/pgimg/41
[ Website ] : http://ogp.me/
γ°γ°γ°γ°γ°γ°
#OpenGraph #Protocol
@ProgrammingTip
Telegram
Programming Tips Resources
Free SSL Certificates On IIS With LetsEncrypt βοΈ
LetsEncrypt is operated by the Internet Security Research Group (ISRG), and is a Linux Foundation Collaborative Project, which is also responsible for the Linux operating system and Nodejs among other projects. π
LetsEncrypt is supported by a range of organisations including Mozilla, Chrome, Akamai and Facebook. π€π»
The certificates that LetsEncrypt issues are recognised by all major browsers, which results in the familiar padlock symbol being displayed on properly secured sites. π
This tutorial shows how to use LetsEncrypt with IIS. π
https://t.me/pgimg/42
[ Tutorial ] : http://bit.do/lenc
γ°γ°γ°γ°γ°γ°
#LetsEncrypt #SSL
@ProgrammingTip
LetsEncrypt is operated by the Internet Security Research Group (ISRG), and is a Linux Foundation Collaborative Project, which is also responsible for the Linux operating system and Nodejs among other projects. π
LetsEncrypt is supported by a range of organisations including Mozilla, Chrome, Akamai and Facebook. π€π»
The certificates that LetsEncrypt issues are recognised by all major browsers, which results in the familiar padlock symbol being displayed on properly secured sites. π
This tutorial shows how to use LetsEncrypt with IIS. π
https://t.me/pgimg/42
[ Tutorial ] : http://bit.do/lenc
γ°γ°γ°γ°γ°γ°
#LetsEncrypt #SSL
@ProgrammingTip
Telegram
Programming Tips Resources
Visual Studio Shortcut Keys π¨
Here is a handy reference that can make your .NET lifestyle a bit easier and more productive. π₯π
[ Website ] : http://bit.do/vsht
γ°γ°γ°γ°γ°γ°
#VS #Shortcut
@ProgrammingTip
Here is a handy reference that can make your .NET lifestyle a bit easier and more productive. π₯π
[ Website ] : http://bit.do/vsht
γ°γ°γ°γ°γ°γ°
#VS #Shortcut
@ProgrammingTip
UnCSS β¨
UnCSS is a tool that removes unused CSS from your stylesheets. β
It works across multiple files and supports Javascript-injected CSS. π
Howβπ€
1οΈβ£ The HTML files are loaded by jsdom and JavaScript is executed.
2οΈβ£ All the stylesheets are parsed by PostCSS.
3οΈβ£ document.querySelector filters out selectors that are not found in the HTML files.
4οΈβ£ The remaining rules are converted back to CSS.
https://t.me/pgimg/43
[ Website ] : https://uncss-online.com/
[ Github ] : https://github.com/giakki/uncss
γ°γ°γ°γ°γ°γ°
#FrontEnd #Css #Tools
@ProgrammingTip
UnCSS is a tool that removes unused CSS from your stylesheets. β
It works across multiple files and supports Javascript-injected CSS. π
Howβπ€
1οΈβ£ The HTML files are loaded by jsdom and JavaScript is executed.
2οΈβ£ All the stylesheets are parsed by PostCSS.
3οΈβ£ document.querySelector filters out selectors that are not found in the HTML files.
4οΈβ£ The remaining rules are converted back to CSS.
https://t.me/pgimg/43
[ Website ] : https://uncss-online.com/
[ Github ] : https://github.com/giakki/uncss
γ°γ°γ°γ°γ°γ°
#FrontEnd #Css #Tools
@ProgrammingTip
Telegram
Programming Tips Resources
SnippetsLab π¬
SnippetsLab makes it simple to manage all of your valuable code snippets in one place with nested folders, tags, and Smart Groups support. π
You can sort your snippets by date, title, and more. π
Features π :
β’ Notes and Fragment
β’ Syntax Highlighting
β’ Gist Integration
β’ Sync & Backup
Available for MacOS π»
https://t.me/pgimg/44
[ Website ] : https://www.renfei.org/snippets-lab
[ AppStore ] : http://bit.do/snplab
γ°γ°γ°γ°γ°γ°
#Tools #MacOS #Snippets
@ProgrammingTip
SnippetsLab makes it simple to manage all of your valuable code snippets in one place with nested folders, tags, and Smart Groups support. π
You can sort your snippets by date, title, and more. π
Features π :
β’ Notes and Fragment
β’ Syntax Highlighting
β’ Gist Integration
β’ Sync & Backup
Available for MacOS π»
https://t.me/pgimg/44
[ Website ] : https://www.renfei.org/snippets-lab
[ AppStore ] : http://bit.do/snplab
γ°γ°γ°γ°γ°γ°
#Tools #MacOS #Snippets
@ProgrammingTip
Telegram
Programming Tips Resources