How to set up a git bare repository for web development code pushes

Hi all, let’s consider that you already have your nice local development environment in which you develop your projects. At some point you’ll want to get to get that project on a public server to share with friends, clients or maybe customers. And of course, since you’re using a version control, you want an easy way of pushing updates to that server. An easy way to do this, is set up a git bare repo on your server....

08 February, 2019 · 2 min · 360 words · Alexandru Bucur

PHP package management history

Reading the great article Modern Javascript Explained For Dinosaurs made me thinking on how that would look like if we were to look at PHP’s history of package management and autoloading. A long time ago in a galaxy far, far away PHP 5 was released. It had numerous improvements compared with PHP 4 (while keeping backwards compatibility) but was still lacking a proper method of including/loading packages from other files....

08 February, 2019 · 4 min · 766 words · Alexandru Bucur

How to disable notifications in ASP.NET Core 2.0 for 'Missing XML comment for publicly visible type or member'

I’ve started playing with ASP.NET since I wanted for a long time to start learning C# but never had the time. Now with Core 2.0 it struck closer to home. Unfortunately, the biggest issue right now is that the documentation is sparse. Going trough the swagger tutorial requires to enable xml generation of the documentation in order to properly update the swagger definitions. Once that’s done you’ll be met with a nice warning Missing XML comment for publicly visible type or member that unfortunately is a pita to work with when developing in Visual Studio Code since it constantly nags you when starting the debugger....

08 February, 2019 · 1 min · 146 words · Alexandru Bucur

How to enable dotnet watch in Jetbrains Raider

Hi guys, while working on my pet API project in C# and .NET Core I realized that I miss having the debugger ‘watch’ for file changes. The standard way of doing this in .NET Core 2.0 is to setup dotnet-watch . It seems that starting with .NET Core 2.1 this step isn’t going to be necessary, so one less step to do. Until then you can follow the official tutorial for setting up dotnet-watch....

08 February, 2019 · 1 min · 205 words · Alexandru Bucur

ASP .NET Core shared Current User

As a quick update to the previous article explaining how to set up JWT and Identity I’ve updated the currentUser method to use dependency injection. 1 2 3 4 5 6 7 8 9 10 namespace Craidd.Extensions { public static class IHttpContextAccessorExtension { public static async Task<User> CurrentUser(this IHttpContextAccessor httpContextAccessor) { IUsersService users = httpContextAccessor.HttpContext.RequestServices.GetService(typeof(IUsersService)) as IUsersService; return await users.UserManager.GetUserAsync(httpContextAccessor.HttpContext.User); } } } In my case, IUsersService is a wrapper that contains dbContext, UserManager and SignInManager....

08 February, 2019 · 1 min · 199 words · Alexandru Bucur

Simple JSON API ASP .NET Core Error handling class

As a follow up to my investigation on API Responses I’ve decided to not create yet another random format and just stick to JSON API even if it means more parsing on the front-end. That being said, ASP .NET Core’s standard response format for ModelState validation doesn’t follow the convention, so I’ve written a small helper class. Unfortunately in .NET Core 2.0 I couldn’t figure out if there’s a way of overwriting the default response format (maybe with an extension method?...

08 February, 2019 · 3 min · 476 words · Alexandru Bucur