Delaying Disqus comments to save (a ton of) requests

My blog is a static website generated using Hugo and running on Netlify (you can read about my move from WordPress to Hugo in a previous article) but I still want to allow users to leave comments on my posts so I use Disqus like many other blogs.

The advantage of Disqus is that you do not need to host the comments yourself, and I really cannot with a static website, you just embed a JavaScript file and everything is taken care of for you. There are a few alternatives to Disqus but none of them works very well so there is basically no other option if you want to have comments on a static website.

The problem with Disqus is that this one JavaScript file you embed to your website makes about 50 requests when a page loads. And that is a lot!

[Read More]

Detecting encoding of uploaded file in ASP.NET MVC

Uploading a file in ASP.NET MVC is very easy, but there is no easy way to detect the encoding of a uploaded text file. However you can use the fact if you try to read the file with a wrong encoding, you get an DecoderFallbackException. So how do you put everything together?

First, get a stream of the uploaded file.

[Read More]

AppHarbor: great place to start your .NET project

If you want to host your .NET project on the Internet, there are classic ASP.NET webhosting on one side of the spectrum and Microsoft Azure on the other. If you are looking for something in the middle, take a look at AppHarbor.

AppHarbor

AppHarbor is a flexible and scalable .NET Platform-as-a-Service, that you can even use for free, limited to one web or worker role. It runs in AWS and is quite similiar to Heroku.

Variety of Add-ons

There are many add-on supported by AppHarbor, including SQL Server, MongoDB, RavenDB, MySQL, Memcacher … Many of these ad-ons offer free versions so you can test them for free. If you run into some problems, you can use the support forums or StackOverflow.

[Read More]