Archived articles - August 2018
Archive for August 2018 (7)
27
Aug
2018
Get most visited pages of your website from Google Analytics using C#
.NET229 titlesList most visited website pages from Google analytics in your .NET application code
0
If you have a website like this one with articles and you would like to suggest most visited articles to your visitors, there are few ways to do this. One of them is definitely a custom solution that can track and store count of every visit per page you have, or without any re-inventing of wheel you can just hook to Google Analytics API to pull the data...read more
26
Aug
2018
Creating Windows service and Linux daemon with the same code base in .NET
.NET229 titlesCross-platform service with C# and .NET Framework
0
Few months back I wrote an article on how to create Linux daemon in .NET Core using generic host class introduced in 2.1 version of .NET Core. This code works just great on Linux OS when configured as a daemon in systemd and provides more less same concept you would have with Windows Service written in .NET Framework 4.x.
The code works just fine on both Windows and Linux hosts, but because it is compiled as a Console Application, you do not really get to run it on your Windows machine as a Service...read more
23
Aug
2018
Manual setup of Kubernetes cluster on a Virtual Machine with kubeadm
Docker3 titlesHow to setup Kubernetes cluster on a Debian Linux Virtual Machine
0
Kubernetes is one of the most popular container orchestrator. It is platform agnostic and although it uses Docker as its default container engine it can also run on Rocket developed by Core OS team...read more
14
Aug
2018
Minify ASP.NET MVC Core response using custom middleware and pipeline
.NET229 titlesHtml response content minification on the fly in ASP.NET Core
0
For my website, since it runs on Umbraco 6 and it is basically ASP.NET MVC application. To reduce load time and increase website performances I decided to alternate the response of the application and minify it using simple regular expression.
Initially I was trying to do this with YUI Compressor library which has .NET port as NuGet YUICompressor.NET which works fine in most of the cases, but in my case does not skip PRE tags which I use for code snippets on the website...read more
09
Aug
2018
Background working scheduled task in ASP.NET Core MVC application
.NET 229 titlesUsing Quartz for scheduling background tasks in .NET Core MVC applications
0
Caching common data like lookups for example in memory of your app can increase significantly your MVC web application performances and response time. Of course this data has to be periodically refreshed.
You can use various approaches to refresh data including expiry, but this can create potential bottle necks in your application since once data expires, you will use request thread to pull the data, cache and serve the request response back...read more
04
Aug
2018
Simple pixel conversion tracking implementation in ASP.NET Core WebApi
.NET229 titlesConversion tracking implementation using pixel method in ASP.NET Core
0
Pixel tracking, although it is the oldest method for tracking conversions in marketing, it is still used widely and some big companies like Facebook are still overing it as one of the methods for tracking the conversions of on your web pages. Tracking conversion via pixel method is still widely used because of it's simplicity...read more
03
Aug
2018
Limit number of tasks running at the same time in .NET
.NET229 titlesHow to throttle number of running tasks to a specific number in C#
0
Limiting the number concurrently running Tasks is not that often requirement in a code, but eventually you'll find yourself in the situation that for the most likely performance issues you'll have to limit number of concurrently running Tasks.
One of these situations is when you have long running operations in the Task. If you spin up to many Tasks you will seriously degrade your application performance...read more
.NET
5
Jun
2022
Using dotnet nuget package vulnerability scan in Azure DevOps build
Listing nuget vulnerabilities and controlling build in Azure DevOps
5
May
2022
Protecting static files in ASP.NET Core using custom middleware
Restricting access to specific static content with middleware in ASP.NET Core
20
Dec
2021
Supporting multiple authentication schemes in asp.net core webapi
Using more than one authentication schemes in webapi projects
12
Dec
2021
Controlling the flow of migrations in EF Core
Altering EF Core migrations execution order
28
Nov
2021
Unit of work pattern with Dapper
Implementing unit of work pattern with Dapper in .NET 5
21
Sep
2021
Adding display name to Enum values
Implementing additional values for Enum items in C#
JavaScript
28
Oct
2018
HTML5 localStorage with expiry with vanilla JavaScript
Using HTML5 localStorage with expiry
8
May
2018
Monitoring DOM changes with JavaScript
Handling DOM changes with plain JavaScript
9
May
2017
Non blocking CSS load on the page
Load external CSS files in an async manner
16
Mar
2017
Serialize html form to JSON without using JQuery
Transform user input from HTML form fields to JSON
17
Jan
2016
Copy text value to clipboard using jQuery
Simple sample of using jQuery to copy value to clipboard
11
Jan
2016
Resize image on the client side with JQuery
Reducing the upload sie by resizing image on the client side
SQL/T-SQL
22
Feb
2022
Select column names with values from SQL Server database
Fetching column names with its value in T-SQL using built in JSON methods
23
May
2020
Identifying opened connections for the specific application in SQL Server
Connection listing queries in SQL Server
3
May
2018
Reading JSON data in T-SQL on SQL Server
Extracting values from JSON string on SQL Server using T-SQL
28
Apr
2016
Create XML/HTML with T-SQL
Generating XML/HTML output in SQL Server
24
Nov
2015
IP address to octets split in TSQL
Split IP addresse into octets in SQL Server
20
Jul
2015
Getting first and last second of the current year, month and day
Using minimum and maximum date time in SQL query
Umbraco CMS
2
Mar
2018
Minify HTML output of your pages
Minification of HTML output using ASP.NET IHttpModule
18
Apr
2015
Generate sitemap.xml on the fly in Umbraco CMS
Simple sitemap.xml Umbraco handler
2
Mar
2015
Accessing UmbracoHelper in HttpHandler request
Working with UmbracoHelper and IPublishedContent in HttpHandler
14
Sep
2014
Same page language switching in Umbraco
Land on the same page in different language in Umbraco using Relations
4
Sep
2014
Getting cropped image the smart way
The way to get cropped image URL with option to load original image too
27
Aug
2014
Fastest way to return JSON result from a controller
Resturn JSON in MVC controller action