During the development of the new version of Acutario in Elixir, we had some issues related to notification dispatching.
One of the improvements we are working on is the possibility of sending notifications to multiple services, like e-mail, Slack, push notifications to mobile apps…
That functionality make us face with the problem of using different strategies depending on a concrete scenario that can be different for each user we want to notify, so we decided to develop a library that help us to manage all that cases. And we called it Ravenx.
The library is made of strategies, which define a way of sending a notification (Slack, e-mail, APNS, etc), and they have an standard interface, so its internal behaviour is abstracted from the outside. …
Having automated tests in a repository can be considered a must-do in any kind of project. In Elixir/Phoenix we can create complex and maintainable tests in a short time but, how can we integrate it with CircleCI?
CircleCI is just another continuous integration platform, free for both public and private repositories. The main advantage is that, as it’s based on top of containers, you can can access via SSH to the container where your tests are running and debug environment/build issues easily.
CircleCI doesn’t have native support for Elixir/Phoenix projects, so the only option left is trying to automatise the installation of the environment needed to run the tests. …
Una de las arquitecturas más populares actualmente es la de centralizar los datos en APIs, separándolos de su representación y haciéndolos disponibles para todo tipo de clientes.
Si bien en ocasiones los contenidos de dichas APIs no necesitan ser consultados en tiempo real, también nos encontraremos casos en los que la respuesta tiene que ser lo más rápida posible y actualizada a los últimos datos disponibles. Para este último caso se puede llegar a una solución intermedia empleando las posibilidades de caché que nos aporta Ruby on Rails junto con Grape, Grape-Entity y Redis.
Si bien no es estrictamente necesario, hay bastantes posibilidades de que en una API desarrollada con Ruby on Rails se utilice grape para encargarse de la creación de los endpoints, el versionado, autenticación, etc. …
I’m a big fan of CloudFlare, but I always have to use a third party service to map my domains to a dynamic IP.
But thanks to the JSON API that CloudFlare uses, now we can update the IP address used in a domain by just issuing a request.
To use this cool feature, you will need a few things:
Also, you’d need to know the ID of the record that you want to update. To obtain it, you only need to issue a command to the…
A few days ago I was trying to find my perfect playlist for work, and I realised that there wasn’t only one. Some times you just want a continuous stream of songs, related to a genre or a search. That’s how PipedBeats idea came to my mind.
PipedBeats is a radio streaming web application that let you to define a genre or some keywords to create a random stream of tracks (generously provided by SoundCloud API) to help you concentrate (or not, it’s up to you!) during your work (or relax) hours.
This week I have been playing a bit with custom routes using ui-router, one of the most popular routers available in the AngularJS ecosystem.
My first idea was to search some data using two optional variables (we will call them var1 and var2). This can be easy, but analysing the use cases we found that:
Now, we have three different scenarios that can be resolved in a few different ways:
Sometimes you may want to do one specific task that requires to build/install some software and/or libraries just to run it once.
Normally it’s very painful to do it in your computer/server because it could left some files that you aren’t going to use, or just because you want to keep your system clean.
I’ve found myself with this problem this weekend, and the solution was very easy: use a specific Docker instance for that.
We want to create a Docker container for the application we need and it’s libraries.
In a normal situation we would create a Dockerfile with instructions to build the whole container, exposing some ports (if it’s a network service) and some mount points. But due to the fact that this machine is going to be use once, it doesn’t care if we do a more manual work. …
During the last weeks I have been working in building my first real Node.js application (in fact, I’m currently using a MEAN stack). So the first step was to look for a good application structure.
TD;LR: if you want to go directly to the code, you can go to this GitHub repository
But.. Why? The short answer is to be able to create a maintainable project, in which anyone can find a specific piece of the app without having to kill me first.
To achieve that, the first step was to look at well known structure for me: the project tree used in a Rails application. …
Last weekend I made a fresh installation of OSX in my personal computer. As the latest version of OSX, El Capitán (10.11), has been released the past week, it was the version I installed.
Also, I decided to look after Rbenv and compare it with RVM (Ruby Version Manager). After looking in some pages like this, it’s clear that the best option (maybe the best structured) is Rbenv, while RVM provides a more comfortable way of managing Ruby versions and gemsets.
In a few words, Rbenv provides:
Today I’ve been installing OpenVPN server on my home server to being able to securely connect to my local network from anywhere. This can allow you to:
In order to get it, my first thought was to install the server on the bare metal machine (not on a Docker instance) because it may require some network privileges that can make it unable to work behind the Docker network layer. …