How to use presenters in AdonisJs Edge templating engine

Introduction

Being a very passionate Laravel fan, I decided to step up and finally try properly AdonisJs. I already tried some small bits of it a couple of years ago, but the generator syntax did not really appeal to me. Finally with async/await we have a battle-tested MVC framework (the current version is 4.1) with modern syntax that brings Rails/Laravel concepts to NodeJs.

The value proposition of the framework is the same that fuels modern MVC frameworks: reduce the time required to be …

Read More
Configure an infrared remote control with Linux

Introduction

Recently I bought a shiny new Intel NUC8i7HNK, equipped with 16 GB of RAM and a 500 GB SSD and I installed Ubuntu 18.04 LTS. I have to say that it works smoothly and my overall experience with it is really positive this far. I don’t really miss the MAC or Windows at all.

The Intel NUC8i7HNK comes with many different expansion options and among these, there is a front consumer infrared (CIR) sensor, so I asked myself if it was possible to control the NUC with a standard TV …

Read More
Get the full path of a File using the Storage facade on Laravel

Introduction

This post is just a reference for the various ways of retrieving the full path of a file using the Storage facade in Laravel.

Under the hood the Storage facade it uses the Flysystem PHP Package by Frank de Jonge, allowing the developer to use the same API with different filesystem drivers (Local, SFTP, Amazon S3, Rackspace and so on).

In this post I’m interested in getting the full path of a file. I will use the local driver, whose methods are relative to the root …

Read More
Nullable objects using JavaScript proxies

Introduction

JavaScript proxies are an ES6 (aka ES2015) feature that lets you wrap an existing object and intercept any access to its attributes or methods, even if they do not exist.

var proxy = new Proxy({ name: "John Doe" }, {
    get: function(target, property) {
        if (property in target) {
            return target[property];
        } else {
            return "Nope!";
        }
    }
});

console.log(proxy.age);         // "Nope!"
console.log(proxy.name); …
Read More
Handling breadcrumbs with VueX in a VueJS Single Page Application

Introduction

At work we are building a complex Single Page Application with VueJS, VueX and VueRouter. As soon as it started to get bigger we found the need to add breadcrumbs to the main interface, in order to indicate to the user exactly where he/she is and to provide an effective navigation mechanism.

At first we searched for existing solutions and libraries, however we only found bits of inspiration, but nothing really ready to use, so we decided to roll out our own solution for the …

Read More
Manage content in a ProcessWire website using Telegram

Introduction

In this tutorial we will learn how to manage content in a ProcessWire website using a Telegram bot.

Today responsive bots are on everyone’s mouth, so I decided to take a deep dive into this new (at least for me) world to learn something new, but also to build something useful using my favourite CMS.

Notice: If you don’t where to start with ProcessWire, I suggest you to look at my 4-part series “How to build a basic webiste with ProcessWire”.

The …

Read More