Gabo Esquivel - Javascript Developer Lean Development, DevOps, Cloud and OSS. JavaScript (Node.js)

Introduction to Gulp.js – Code Over Configuration

Automation of repetitive and critical tasks is key to develop a successful software product. Automated tasks will minimize software cost, reduce software delivery time as well as improving the product quality and reduce human error. Investing time in automating tasks will allow you to focus on developing features.

“War is of vital importance to the state; hence it is a subject of inquiry which can on no account be neglected”
– Sun Tzu, Art of War

In this post I will introduce you to Gulp.js, a javascript task runner that helps you automate your development process.

Setting Up your Web App Build System

When developing modern web applications there are critical tasks you want to automate:

  • testing: code linting, unit testing, e2e tests
  • css preprocessing ( sass, less, …)
  • optimization: concatenating and minifying css and scripts, compressing new or modified images, …
  • deploying updates to a staging or production server

There are many tools that will help you automate these tasks. Which one to choose? Grunt, Gulp, Brunch, Broccoli,…

Back in 2012 Grunt.js came out and it was quickly adopted by the community, plugins started to proliferate and it became king for task automation on the client side, playing well with Bower and Yeoman. Like many other developers I’ve been using Grunt on my projects and it gets the job done but recently I started to use Gulp, another open source project with faster build times and a Unix/Node philosophical approach to solve problems.

Gulp.js focuses on code over configuration. By harnessing the power of Node streams, it enables faster build times by avoiding the need to write temporary files to disk. This is one of the main differences with Grunt. Stream instances are basically Unix pipes. They can be readable, writable or both and are easy to reason about — you can pipe a readable stream to a writable stream by doing readableStream.pipe(writableStream).

“Streams come to us from the earliest days of unix and have proven themselves over the decades as a dependable way to compose large systems out of small components that do one thing well.
You can then plug the output of one stream to the input of another and use libraries that operate abstractly on streams to institute higher-level flow control.”

– substack

Overview of Angular Generators – April 2014

This is a short and opinionated review of the AngularJS generators on npm as of April 19th, 2014.

There are a lot of generators on npm and it’s a little hard to decide which one to use or fork, since we don’t want to reinvent the wheel. Currently the only way to compare them is to try them one by one and that’s a very time consuming task. In this post I’ll try to give you an overview of some generators I’ve explored recently hoping it will save you some time. I’ll follow Cliff Meyer’s Code Organization Categorization to describe their code structure.

Most generators still use the “Sock Drawer” directory organization, an approach that I personally avoid, it doesn’t scale well but it works for small projects. I prefer a modular structure as suggested on latest Google’s Best Practice Recommendations for Angular App Structure.

Some of the benefits of modularization are:

Encapsulation: Code, styles and tests related to specific feature will be contained on the same directory.
Context: Code lives in given context by feature. This is specially important to developers new to the application, who will find it easier to connect the dots.
Code Reusabilty: You would be able to reuse modules across projects and clients, Eg mobile and web-client could share autentication modules or resources ( models ).

Here’s a list of Angular generators and their characteristics (some of them are fullstack generators):

Developing Software in Paradise, Aka Costa Rica

Coming back to Costa Rica and enjoy my country while working on software applications is one of the best decisions I ever made. Check out these pictures I took with my phone at Playa Manzanillo, near to Santa Teresa – Mal País, a natural paradise with world class surfing that ranks among the most beautiful beaches of Costa Rica and you’ll agree is the best place to live or invest in the country.

playa-manazanillo-sunset vacas-playa-manzanillo playa-manzanillo-reef rocks-playa-manzanillo

Santa Teresa was recently awarded by Trip Advisor as the #1 highest-rated travel location in all of both Central and South America. Malpais and Montezuma both have many of the best restaurants in the entire country, since many international chefs have moved to the area. The area is also a major center of Costa Rica Yoga with over a dozen places to learn/practice and many yoga retreats and surf+yoga retreat combinations.

Elion Chin, co-founder of MoodLogic – one of the first online music recommendation systems, is leading Silicon Beach a forum for entrepreneurs & people looking to invest in, work at, advise or network with startups in Costa Rica to promote the technology talent of Costa Rica and drive the start-up culture in a fulfilling and healthy environment to deliver the best.

Silicon Beach Costa Rica

Choosing the Data Store for Your Web App

When choosing a database for your application, you need ask yourself many questions and there are important rules about Data Architecture

  • there’s no standard solution that fits all
  • the business and it’s data defines the architecture
  • you need to find the right tool that does job
  • you can use multiple databases, different types depending on the characteristics of each data subset

It is very important to decide carefully, after your application grown it could be very difficult to change. The CAP theorem, also known as Brewer’s theorem, states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees:

  • Consistency (all nodes see the same data at the same time)
  • Availability (a guarantee that every request receives a response about whether it was successful or failed)
  • Partition tolerance (the system continues to operate despite arbitrary message loss or failure of part of the system)
CAP Theorem - Venn Diagram

Once you have defined which of those guarantees is less important for your app and can be sacrificed, you have a smaller subset of options to choose from. However this not the only thing you need to consider, you may want to use a specific framework such as Hibernate, Spring, Django or WordPress, and take advantage of the of-the-shelf capabilities, in that case you want to use a SQL database.

Data Visualization in Costa Rica

I’m very excited to announce that we’re starting a data visualization meetup group in Costa Rica!

At Hack/Hackers San José event I finally had the pleasure to meet Yuri Engelhardt in person after months of exchanging emails and ideas about data visualization. Yuri is the co-founder of Show Me Data, an annual multidisciplinary course and public event that brings together the University of Amsterdam (UvA) and the Utrecht Graduate School of Visual Art and Design (maHKU) students to get familiar with the world of data visualization. After the event we exchanged a couple more emails on the topic and we decided to create a meetup group to bring together all professionals and data visualization enthusiasts to share our knowledge and ideas. That’s how the Costa Rica Data Visualization Group was born.

Data Visualization Costa Rica is a non-profit professional group that aims to meet monthly to discuss data visualization, data communication, infographics, exploratory data analysis, charts and graphs, perceptual psychology, and more! It is gathering point for data journalists, programmers, data scientists, business intelligence professionals, and others who tell stories with data. Meetup topics will vary and range from tutorials on basic concepts and their applications, to success stories from local practitioners, to discussions of tools, new technologies, and best practices.

We believe in data visualization, information design and digital media for social and environmental causes – e.g. in education, health, civil rights, sustainability citizen engagement, transparency and accountability.

If you are interested go to and join us to receive notifications and updates of our events.

My Favorite JavaScript and Engineering Podcasts

updated on 05/2015.

Javascript Jabber

Simply the best Javascript podcast out there. By Charles Max Wood, Joe Eames, Merrick Christensen, AJ O’Neal, Jamison Dance, Aaron Frost

NodeUp – NodeJS Awesomeness

A node.js podcast put together by @ffloat and @dshaw..

The ChangeLog – Open Source Moves Fast. Keep up.

The Changelog is a weekly podcast and blog that covers what’s fresh and new in Open Source.