Node.js Notes


Here I oppose three different ways to export modules on node.js

Lets say we want to export three functions from a file called count.js

var counter = function(arr){
	return 'There are '+ arr.length + ' elements';

//This can be done by using backticks

var adder = function(a,b){
	return `The sum of two numbers is ${a+b}`;	

var pi = 3.142;

First way


module.exports.counter = counter;
module.exports.adder = adder;
module.exports.pi = pi;

Continue reading “Node.js Notes”


Image manipulation

When I was younger, I considered myself as an animal friendly person. At some point, I realized that all the bacon and the chicken I was consuming used to be living creatures and that the money spent on their purchase was just sponsoring their death camps, similar to the Nazi ones.

Dedicated to all animals

Below, you can see a more advanced example of image manipulation than in the previous post.

When I manage my time, I will apply further math and physics to this project, in order to lighten it up and enrich it with lots of different effects.

At the moment, the program is likely to challenge your device, especially if it’s a mobile.

Manipulation Panel
Speed (max 300)


Canvas negatives

Below I created a basic canvas function which transforms an image into its negative form, in various ways and styles. Some of the parameters that I use are there just for fun, and because I enjoy playing with colors and images. I wonder what Leonardo would do if he had access to this kind of technologies. I expect this not to work at some mobile devices. Tell me if you like it or if you have any additional ideas.

Continue reading “Canvas negatives”


Useful Javascript Helpers

After writing tones of code you’ll get bored to write the same (helper)functions over and over again for each new project. Functions to short tables, scroll to top, detect mouse position, show pop-up boxes and more are very useful on each public project. I’m not giving you optimized code here, instead I’m showing some basic stuff in order to get inspiration! It is better in my opinion not to use jQuery but for the sake of simplicity I’ll use this library here.

At the bottom of this article I referance some great articles with great javascipt helper functions.

Continue reading “Useful Javascript Helpers”