Here is a strange request: Write hello world using ASP.NET. So easy, dotnet new mvc then modify Views/Home/Index.cshtml to return a single line of <p>hello world</p>. Must be it, right? There is another way 😀 1. What is middleware 2. Types of middleware 3. Default middleware 4. Writing a middleware 4.1. Using delegate 4.2. Using …
[OOP] – Differences between Abstract and Interface?
A very common interview question: The differences between abstract and interface? Interface Think of interface as the USB port on your flashdrive. When buying a new laptop, you don't think "does it compatible with my flahsdrive", but you think "does it have a USB port?". And you know that every single computer on this planet …
Continue reading [OOP] – Differences between Abstract and Interface?
[Docker] – From a beginner perspective
To be short, docker like a virtual machine that you can use as a server to host your website. It uses the concept of container to do this. When deploying for production, you just grab the container and 'put' it inside a docker service, and start, everything else would be the same as it was …
[Ruby on Rails] – mysql2 with Ruby 2.4 on Windows
Developing Ruby on Rails on a Windows system is such a pain. But with some nice tips and tricks, it would be enjoyable. In this tutorial, I will instruct you on how to install and use mysql2 gem version 0.4.10 (the last version that support rails 4.2) on a Windows system 1. Required software 2. …
Continue reading [Ruby on Rails] – mysql2 with Ruby 2.4 on Windows
[ASPNET] EditorFor with List and add more item to list with AJAX
Imagine you have a list of items in ViewModel What if you want to let user add 1 more item, or let user edit any item in that list? In this blog post, I will show you how to do just that The EditorFor Control The class C# code JavaScript Code Usage Prepare the model …
Continue reading [ASPNET] EditorFor with List and add more item to list with AJAX
[ASP.NET] Extend EditorFor control
You may familiar with EditorFor control, but it renders supported types only. What do you do to extend EditorFor to render your own type? Table of Contents 1. The usage EditorFor and EditorForModel The model (or ViewModel) The View 2. Extend the EditorFor 2.1 Create EditorTemplates No doubt the most useful control is Editor Extensions …
[Front-end] Auto reload browser while coding
Touching CSS is painful every single time Front-end developer usually do this: edit a single character in CSS (or SCSS), save, then head over web browser, hit reload / F5 / Ctrl + F5 What if there is a way to make the browser auto reload while you're typing? This blog post will guide you …
Continue reading [Front-end] Auto reload browser while coding
[Visual Studio Online] TFS love Slack, and vice versa
This post will guide you through how to intergrate TFS into slack. Every time there is something happened in TFS (code checked in, new task, etc…), there will be a message posted in slack in selected channel. Sound good? Here how Activate in TFS Open your TFS link, usually it will be “blahblahblah.visualstudio.com”. You will …
Continue reading [Visual Studio Online] TFS love Slack, and vice versa
[UWP] Create image assets for your apps
Windows 10 apps (or Universal Windows App) required a lot of images to use in assets. Each images have different resolution and scale. How can you create all of these images? Open Photoshop or GIMP to crop, resize, and save, and repeat for 39 times until done? Today I will show you a quick and …
[UWP] Get all the latest sample code at ease
Back in the old days, if you want to look at some sample code, you have to do a search > go to MSDN page > download sample code as .zip > extract the zip > open the .sln file to view. Now, Microsoft is cool again. All of the sample code for Windows 10 …
Continue reading [UWP] Get all the latest sample code at ease