Skip to content

Create a plugin for Google Protocol Buffer

Google’s Protocol Buffer is a library to encode and decode messages in a binary format optimised for compactness and portability between different platforms. At the moment the core library can generate code for C/C++, Java and Python but additional languages can be implemented by writing a plugin for the Protobuf’s compiler.

There is already a list of plugins to support third party languages however you can write your how plugin to output custom code tailored for your needs. In this post I’m going show an example of a plugin written in Python.

Continue reading Create a plugin for Google Protocol Buffer

Restricting npm semver rules

The npm package manager uses semver to declare the version of the external dependancies of your package in a more flexible way. Unfortunately the current version of npm by default uses the caret ^ as a default prefix for package’s versions which means the required package must have the same MAJOR version but can have a different MINOR and HOTFIX versions; this can lead to a broken code if a change in the MINOR version of the dependancy introduce an incompatibility with your code. Replacing manually all the carets with the tilde ~ is tedious and error prone so we need a way to set npm to use the tilde by default.

Continue reading Restricting npm semver rules

HTML augmentation with React

These days is all about React. Most of the people are leaving the bandwagon of AngularJS in favour of the React’s bandwagon for a lot of different technical and not-technical reasons (#TROLLING they switch because is the new JavaScript Toy of the Year). But today and here I’ll not talk about that, however I’ll talk about if it’s possible to use React to augment a static or server-side rendered page; this is necessary to allow search engines to crawl and index your website (remember that crawlers doesn’t run Javascript code). The long answer is TL;RL, the short answer is “keep reading”.

Continue reading HTML augmentation with React

Hide JavaScript code into images

In this post I’m going to explain how it’s possible to hide JavaScript code into a PNG image and executing it into the browser without leaving any trace in the HTML document. This kind of hiding technique can be used to load JavaScript code into the browser bypassing the common scanning for malicious files because usually the content of an image is considered to be pixel’s information and not executable code.

Continue reading Hide JavaScript code into images

YouTube TV with remote control

YouTube is the most successful and well known platform for video sharing, the available video content is huge with around 100 hours of videos uploaded on their servers every minute. Personally, I’m spending more time on the YouTube platform than watching my TV.

The YouTube platform already offers to you a good website where enjoy your preferred content but it can do more it can offer a remote controlled home-theatre interface to be enjoyed from your sofa just by your laptop and your Android device.

Continue reading YouTube TV with remote control