Sideprojects Motivations and Goals

Hi Everyone, This is more of an introspective blog post regarding side-projects and finding the motivation and time to do other ‘work’ outside of the daily job. As you may or may not notice, I had a solid 6+ months pause from blogging. The main issue here was the fact that I have the tendency at times in my side projects to search for the best solution, and not focus on the task at hand....

04 August, 2019 · 3 min · 427 words · Alexandru Bucur

How to Stop requestAnimationFrame in Vuejs / Javascript

TLDR: 1 2 let id = window.requestAnimationFrame(fancyFunctionHere) window.cancelAnimationFrame(id); Now for the longer version. Technically in Vue.js you might have components/mixins that use window.requestAnimationFrame. Since the fancyFunctionHere is used as a callback, everytime you call window.requestAnimationFrame you are going to get a new id that you should use on the destroy method to stop it. Unfortunately this is not imediately clear on MDN so hopefully my documentation edit with the comment in the code example goes trough....

20 July, 2019 · 1 min · 131 words · Alexandru Bucur

Systemctl shows service file Not Found even though .service file is present

Hi All, I’m writing a step by step setup for a self hosted gitea instance (on CentOS 7) and hit the stupidest bug (if you can call it that) of systemd. After writing the gitea service file I was getting the following error: 1 2 [root@gitea ~]# systemctl start giteaselfhost Failed to start giteaselfhost.service: Unit not found. After a few hours of maddening permission checks and debugging, the problem was that I had a Requires dependency to a service file that wasn’t there....

17 June, 2019 · 1 min · 104 words · Alexandru Bucur

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

How to setup Font Awesome 5 as VueComponent in Nuxt.js

There were a couple of things that I needed to understand in Nuxt.js so hopefully this will make it quicker for other people as well To have a global component in Nuxt, just create a plugin. Even if the documentation isn’t very clear on setting that up it works well if you look around the Github issue list Font Awesome 5’s VueJS integration works well, but you need to keep in mind to install the icon categories....

08 February, 2019 · 2 min · 225 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

Setting up JWT and Identity Authorization/Authentication in ASP .NET Core

Continuing my foray into ASP .NET Core, and making sure I get outside my comfort zone, I got into the situation that I want to be able to easily access the logged in user information in my API request. There are several versions available online, some unfortunately out of date (mostly because ASP .NET Core 2.0 is relatively new and things changed significantly in Identity between 1.0 and 2.0). First version I stumbled upon recommended extending the IHttpContextAccessor....

08 February, 2019 · 3 min · 484 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