#javascript

14 posts in this collection

Emerging JavaScript pattern: multiple return values

In this article, I want to explore an interesting pattern that I am seeing more and more in JavaScript code which allows you to return multiple values from a function. You probably know already that JavaScript does not support multiple return values natively, so this article will actually explore some ways to “simulate” this behavior. One of the most famous usages of this pattern I have seen recently is within React Hooks , but before delving into that, let’s see what I mean with “multiple return values…

My Serverless talk at Shift conference in Split

This June, I had an amazing experience talking again about Serverless and how we use it at Planet 9 Energy at the recent Shift Conference in Split, Croatia. In my talk titled ” Serverless: The pros and cons of building a company without infrastructure ”, I tried to address what Serverless is and why is becoming such a big thing, also exploring what I believe are the pros and cons of this new paradigm. The experience was great and I was super happy to have a chance to share the stage with extraordinary…

My Universal JavaScript Web Applications talk at Codemotion Rome 2017

Last month (March 25th) I had the pleasure of delivering again my Universal JavaScript talk in a Codemotion Event, this time in Rome . As expected it was a super interesting event and it gave me the chance to meet fantastic people, attend inspiring talks and refine my presentation. Judo Heroes Version 2 For this occasion, I updated my common Universal JavaScript Judo Heroes to ” Version 2 “. I believe this new version looks a bit more polished and easy to understand, plus it features a number of other…

Unshorten (expand) short URLs with Node.js

Short URLs have been an invaluable tool for social media marketing for so many years and we are now used to seeing them everywhere. Most of the credit probably goes to URL shorteners services like Bit.ly , Goo.gl , YOURLS and Rebrandly that popularised the concept and made easy for everyone to start creating short URLs. When working with URLs in some automation scenarios like analytics, information crawling, data retrieval, etc. it can be important to resolve (or ” unshorten ” or ” expand ”) short…

My Serverless & AWS Lambda talk at Node.js Dublin January 2017

Last January I had the pleasure to share the stage with the great Padraig O’Brien to talk about how we use Node.js, AWS Lambda and the Serverless framework at Planet9 Energy . The talk was hosted by the monthly Node.js Dublin Meetup at Intercom Dublin office, as usual, a very cool location for this kind of tech talks. Apart from having a great chance to show off my über cool Super Mario T-shirt for about 45 minutes, Podge and I had some good time discussing the following topics: What does ” Serverless…

My Universal JavaScript Web Applications talk at Codemotion Milan 2016

Yesterday (25/11/2016) I had the pleasure of delivering a talk about Universal JavaScript at Codemotion Milan 2016 . It was a great fun and I was very happy to meet such a big pool of technology enthusiasts and professionals all in one places. I’m already looking forward for the next edition! Video Update (12-12-2016): a video recording of the talk has been published by the folks at Codemotion: Slides deck If you are interested in my talk you can find the slides on Slides.com : Commentary Here follows…

How to crack a JWT token: two articles about distributed computing, ZeroMQ & Node.js

In the last 2 weeks I add the pleasure to release an article (in two parts) in collaboration with RisingStack , one of the most famous companies in the Node.js ecosystem. The article explains how to build a distributed application using Node.js and ZeroMQ and provides an example that I believe it’s very actual and interesting: a JWT token cracker. If you are into Node.js, ZeroMQ, security or distributed application you can read the two articles in the community section of RisingStack. ZeroMQ & Node…

Two Interviews about Node.js, JavaScript and being a book author

In the last month I had the pleasure to seeing published two interviews regarding my life as developer with Node.js and JavaScript and about being a book author with Node.Js design patterns second edition . The first interview was made with the Packt Publishing team and it was published in their own website: With Node.js, it’s easy to get things done The second interview was made by Thomas Peham , marketing manager at UserSnap : Meet the community: Luciano Mammino, software developer from Sicily I…

To promise or to callback? That is the question...

You are building the next cool JavaScript or Node.js module with a lot of asynchronous functions and you are very happy about it. At some point a terrible doubt assaults you: Should my API offer support for callbacks or should it be promise based? In this article we are going to show a very simple way to add support for both promises and callbacks in our asynchronous modules, this way we can make everyone happy and our libraries much more flexible. The problem Promises can be used as a nice replacement…

Introducing Gulp cozy - Manage your gulp tasks in a cozier way

Gulp-cozy is an experimental NPM package that allows you to organize your Gulp tasks in a more modular way with simplicity and “cozyness” in mind. Rationale Ever found yourself digging into a gigantic monstrous with hundreds of functions and tasks scattered all around? If it happened to you I am sure you can tell that it’s not a great feeling… That’s the reason why I created this small module as an attempt to help with keeping yourself cozier (and happier!) when working with Gulp. In a way it tries to…

Gulp and FTP: update a website "on the fly"

In this post I will explain you how to use Gulp to interact with the files on your server through FTP. You will learn how to watch the files you are editing on your local machine and automatically synchronize them with your server as they change and how to setup a task to launch an FTP deploy on demand. Premise Few days ago I was assigned to take care of updating few sections on a legacy website which development environment is currently accessible only through FTP . So no local virtualized development…

Versioning and deploying a static website with Git, Flightplan and Nginx

Do you ever wondered how to manage the versioning and deployment process of a website? It seems to be a very interesting yet complex topic for which there are already thousands of different solutions. In a recent collaboration with Usersnap I had the pleasure to write a very detailed article for their blog that proposes a solution based on Flightplan.js , Git and Nginx . My solution is very simple, it requires very few dependencies on your system (Git and Node.js) and it has been thought to give…

Introducing flickr-set-get a command line app to download photos

I recently developed a small command line app that allows you to download an entire gallery from Flickr, it’s called and you can find it on NPM and GitHub . Why? To be honest I had myself the need to download a large set of photos (more than 400 photos) from Flickr and I didn’t wanted to do it manually. I also wasn’t able, after a quick search, to find something simple to solve this task. Given that I am currently getting into deep of Node.js this was the perfect chance to develop something practical…

Integrating Twig.js and BazingaJsTranslationBundle

Recently I had the need to run a twig template that uses the filter on my frontend using twig.js , a pure JavaScript port of twig written by the good Johannes Schmitt . The JavaScript version does not handle all the functionalities offered by the original PHP version (even if it goes pretty close) and in particular it does not natively handle the filter. So, at first, I got a JavaScript runtime exception on my page when trying to use the template. Luckily enough the JavaScript version of twig is…