Ir al contenido principal

Entradas

Be Agile with Codetags

To put it simple, Agile methodology is based on quick iterations. That approach implies that:  We must be fast coders to complete each iteration in the scheduled time Soon or later we'll go back to that code we quickly wrote in the past If we only focus in the first statement ( be faster, my friend ), codebase quality tends to degrade, code entropy -or the codebase maintenance complexity- increases, bugs start to consume more and more time in every sprint and, in last term, software components must be fully re-coded, what can consume great part of the benefits we got by becoming agile. However if we have in mind that, in coming iterations, we'll have to refactor the code we are working on right now, we can document the technical debt we intentionally create with the purpose of fixing it in the future. In that way, when planning every iteration (or sprint) we can schedule a percentage of the coding effort to fix that debt we left, theref...

Google Cloud Storage: List files with wildcards

One of the most fustrating things when using Google Cloud Storage is not being able to search files using wildcards: Google Cloud web interface only allows stating a file prefix, what in many cases is not enough. Luckly, Google Cloud SDK gsultil ls , also available throught the Google Cloud Console, allows listing storage bucket contents using wildcards. Let's see some examples: Listing all the available buckets gsutil ls Listing a specific bucket content gsutil ls gs://my_bucket Listing, in a specific bucket, all the files matching a classic wilcard pattern As usual, * symbol matches zero or more characters, ? symbol matches only one character. gsutil ls gs://my_bucket/foo*.json gsutil ls gs://my_bucket/*bar.json gsutil ls gs://my_bucket/foo*bar.json gsutil ls gs://my_bucket/foo*.jso? Listing, in a specific bucket, content matching advanced wilcard pattern A set of characters into brackets matches all the filenames that has one of those characters. For i...

Go code organization (in a nutshell)

Debugging Google Cloud Functions in Node

DISCLAIMER: This article focuses on Google Cloud Functions with HTTP signature, ie, those functions intended to be triggered by an HTTP request. In case of being interested in Cloud Functions being triggered by Cloud Storage, File Storage or Pub/Sub events, read Debugging Google Cloud Functions with event signature in Node . Cloud Functions, the Function as a Service (FaaS) product of Google Cloud, is an attractive resource for those developing solutions in cloud environments. Similar in conception to AWS Lambdas or Azure Functions, they offer serverless processing at an affordable price. From the developer point of view, they don't differ too much of a standard function contained in a program developed in Node, Python, Go or Java, except for debugging: Due to their ubiquitous nature debugging is not easy and most of the times is done following one of these two approaches: Uploading a debug version, running it and then checking its output (logging and/or funct...

Port forwarding with Docker Toolbox

Though most of the computing resources, as Docker containers, run now in the Cloud, soon or later the modern programmer needs to deploy some stuff in its local computer. In that scenario, chances are that you had to install the Docker Toolbox, the legacy solution for older Mac and Windows systems, instead of just installing the new Docker Desktop. One of those scenarios is that in which your computer hardware or software doesn't support hypervisor frameworks (older Intel processors not supporting virtualization technology, for instance) So you've downloaded and successfully installed Docker Toolbox and now you have a cool VirtualBox machine running in local. Everything seems promising, so you code a simple  HTTP server that greets you with an original "Hello World!" when you make an HTTP GET request to the port 80. You've tested it in your local machine and it works!, so you decide to create a container and put you...

gcloud: Run cloud functions from command line

Tired of that slow web interface that Google Cloud Console offers to those lazy programmers out there? Then gcloud comes to your help. Among other miriad of functions, gcloud allows calling GC functions from the command line of your computer. For instance, this command calls the helloWorld function, deployed on the cloud region "europe-west1": gcloud functions call helloWorld --region="europe-west1" Calling  gcloud functions list  is the way to get all the available GC functions, together with their state, trigger and cloud region. Functions input data Most of the times your functions will require some data input to work. Depending on the function triggering method, data can arrive in different ways (in the body of an HTTP request, in a PubSub message...), but they way of sending that data from the gcloud command is always the same: gcloud functions call helloWorld \ --region "europe-west1...