How to mock websocket endpoints

npm js mock nodejs

Have you ever need to mock some sort of websocket endpoint during the early stage of development of an application? I do. I could easily mock REST apis with json-server, but then I had to wrote something allowing me to mock sokects also.

The result is ws-server-ftw (ws-server was taken on npm, uh). Let's start with a screencast...

Basically, ws-server-ftw provides a way to easily mock websocket endpoints, serving a json file or a js file exporting an object. Using ...

read the full post

A shiny Hamster report template

productivity hamster

Hamster is a gnome time tracker application which aims to increase your productivity by monitoring the time spent on different projects and activities. It's quite simple, its usage is straightforward and I think this is it's greatest feature!

Hamster let's you export your data in html format, but the default template isn't very attractive, this is the reason I spent some time to create a new report template based on semantic UI.

You can find it on my github account ...

read the full post

Inspect redux store in remote applications

react tips

Sometimes it may be usefull to access the redux store also in the remote deployed application.

Here are 3 simple steps you may use to accomplish it with google chrome:

  1. Install react developer tools
  2. Select the Provider component in the react inspector tab
  3. Open your console, digit $r.props.store.getState()


How to customize django change form redirect url

django-admin django

Sometimes may happen you need to customize a bit more than usual your django admin interface. Maybe because you need a different dashboard approach, or you just need to aggregate functionalities in a way which differs from a pure CRUD interface. Anyway, if possible, you try to keep the change and delete form code of the django admin, because you really are too lazy to rewrite all the add/change/delete stuff.

In such a situation I found myself searching ...

read the full post

Otto Backup, a friendly rsnapshot GUI application

backup rsnapshot python

Every developer have to deal with backups. In the linux world the most used tool is probably rsync, and often it is run through rsnapshot, which lets you create incremental snapshots of your directories.

Almost any developer will not have any problems configuring and running rsnapshot through the command line and add it to the crontab schedule, but what if one of your clients asks for a way to download manually a backup of their application?

You could solve this ...

read the full post


geolocation react-native react-native-location-manager

Managing location related tasks inside a react-native project can be quite frustrating. I've encountered many problems, for example when getCurrentPosition was always returning me a cached position object, despite of my configurations. For this reason I wrote a getLocation function that tries to incapsulate all the code needed to get a reliable position with a fallback to low accuracy mode.

But getting the real location is only a part of the story, which consists of many other tasks:

  • authorize the app to access location
  • enable location setting if disabled
  • inform the user about what it's going on
  • ...

So I finally decide to wrote a reusable component which tries to manage all this stuff in one place, which makes use of ...

read the full post

Geolocation with react-native

geolocation react-native

I've had many problems with react-native geolocation module.

In particular I faced a weird behaviour of the getCurrentPosition method: while the world was lamenting timeout problems, probably due to the fact that gps tracking is not fast at all in closed spaces, my problem was that with highAccuracy set to true, the returned value was always a cached one, no matter how I set maxAge option.

If your problem is a timeout problem, then you can just call getCurrentPosition with ...

read the full post

A vim configuration model


I've been a vim user for many years, I tried so many plugins I just can't remember, I changed my vim configuration very often reaching a sort of model that now, with vim 8 and async jobs on stage, I'll ...

read the full post

Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!