posted by Alex Gorbatchev on July 9th 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

When a small web project gains traction and more people join and begin editing the CSS files, it becomes progressively more difficult to keep everything consistent. Creative people hand off a new element style to a developer who just joined the team. Our protagonist has been around the block and promptly opens up a favorite color picker and grabs the colors from the JPEG. It looks good. Next day same things happens, and then again and again.

In a short amount of time there are now 20 color values in the CSS that are all factually different from each other yet represent the same color visually. colorguard (GitHub: SlexAxton/css-colorguard, License: Apache 2) by Alex Sexton helps you maintain the color set that you want, and warns you when colors you've added are too similar to ones that already exist.



posted by Eugeny Vlasenko on July 8th 2014

My name is Eugeny Vlasenko and I want to introduce my logging module called mag (GitHub: mahnunchik/mag, License: MIT). There are lots of full-featured logging frameworks such as Bunyan [GitHub: trentm/node-bunyan, License: MIT) Winston (GitHub: flatiron/winston, License: MIT) or log4js (GitHub: nomiddlename/log4js-node. Why write another one? Personally, I subscribe to the twelve-factor app methodology and more specifically the part about logs. Another cool thing about mag is that it’s fully built on Streams3.


Links for July 3, 2014

posted by Alex Gorbatchev on July 3rd 2014


  • Visualizing Algorithms

    Algorithms are a fascinating use case for visualization. To visualize an algorithm, we don’t merely fit data to a chart; there is no primary dataset. Instead there are logical rules that describe behavior. This may be why algorithm visualizations are so unusual, as designers experiment with novel forms to better communicate. This is reason enough to study them.

  • The introduction to Reactive Programming you've been missing

    The hardest part of the learning journey is thinking in FRP. It's a lot about letting go of old imperative and stateful habits of typical programming, and forcing your brain to work in a different paradigm. I haven't found any guide on the internet in this aspect, and I think the world deserves a practical tutorial on how to think in FRP, so that you can get started. Library documentation can light your way after that. I hope this helps you.

  • How Psychedelics Saved My Life

    I founded the website, to produce and aggregate journalism on consciousness, natural medicines, and therapies. Psychedelic explorer Terrence McKenna compared taking psychedelics to hitting the ‘reset button’ on your internal hard drive, clearing out the junk, and starting over. I created to help connect those who need to hit the ‘reset button’ in life with journalism covering the tools that enable us to heal.

  • AngularJS - Providers

    Factories are a common paradigm in Angular that allow you to configure a function that returns an object which can be then injected into controllers.

  • Moving Atom To React

    Performance is a top priority for the Atom team, and recently we’ve been focusing on making basic text editing smoother and more responsive. After some initial incremental progress, we decided to take a step back and rewrite the editor component's view layer with a superior framework and a better understanding of the problem.


Ten open source Node.js apps

posted by Alex Gorbatchev on July 1st 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

In this article we are going to quickly look at 10 open source Node.js applications. I want to shed some light on a few awesome Node.js projects for the sake of exposure and hope that you (just like me) would read and learn from their source code even if the applications themselves are of no interest to you.


Links for June 30, 2014

posted by Alex Gorbatchev on June 30th 2014


  • Error Handling in Node.js

    Error handling is a pain, and it's easy to get by for a long time in Node.js without dealing with many errors correctly. But building robust Node.js apps requires dealing properly with errors, and it's not hard to learn how.

  • MongoDB and Amazon Web Services: Deploying for High Availability

    Best practices are meant to be a sensible starting point

  • CSS: The Good Parts

    This style guide is a jab at solving collisions between CSS class names, and issues that ultimately lead to confusion, having to use !important rules, copying and pasting style declarations, and other awful aspects of CSS developments.

  • Emulators written in JavaScript

    This list started as a compilation of JavaScript emulators posted to Echo JS over the years.

  • Develop a NodeJS App With Docker

    This is the first of two posts. This post covers a somewhat detailed tutorial on using Docker as a replacement for Vagrant when developing a Node app using the Express framework. To make things a bit non-trivial, the app will persist session information in Redis using the connect-redid middleware.

  • Candy Japan crosses $10000 MRR

    Out of that $10k / month revenue of course not all (not even most) is profit. Compared to a SaaS, the costs are very high, but I've carved enough profit margin to reach an income level similar to a Japanese salaryman now.



posted by Alex Gorbatchev on June 26th 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

I'm always on a look out for interesting modules and unusual solutions. When working with promises in Node.js, there's a constant friction between callbacks that is Node's defacto interface and your desire to use promises throughout your entire project. The now famous Bluebird (Github: petkaantonov/bluebird, License: MIT) library has a good collection of helper methods to assist you in going to and from callback world.


Comparing Winston and Bunyan Node.js Logging

posted by Alex Gorbatchev on June 24th 2014

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

If you are writing a Node.js application, chances are you going to have some kind of API end points to be consumed by your frond end or expose data for others to take in. This is where RESTful APIs come in. And now you have a dilemma - what tools to use and what approach to take? So many choices...

Lets talk about logging, shall we? Arnold over here carrying a giant log feels like an appropriate intro to this article in which we are going to talk about popular Node.js logging frameworks.

If you are writing any kind of long living application, detailed logging is paramount to spotting problems and debugging. Without logs you would have few ways of telling how is your application behaving, are there errors, what's the performance like, is it doing anything at all or is it just falling over every other request when you aren't looking at it.


Links for June 17, 2014

posted by Alex Gorbatchev on June 17th 2014




posted by Alex Gorbatchev on June 16th 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

Data access is something Node.js is very well known for. When it comes to drivers, there's support for nearly every database under the sun. These days however, in most cases you use an ORM library instead of a plain driver. It saves you time and you don't have to write every single thing youself.

There are database specific ORM libraries such as Mongoose for MongoDB and Sequelize for MySQL and PostgreSQL. The downside to this approach is that you have to learn a whole new API when you have to go from one database to another. I'm not suggesting it's a good idea to switch or use different databases during a lifecycle of a single project (eg SQLite for development and MySQL for production). But going from project to project, client to client, your requirements might change and you will have to use a different database and then learn a whole new API. Fun? Yes! But if you have to delivery features quickly, this might be a setback.


Links for June 6, 2014

posted by Alex Gorbatchev on June 6th 2014


  • Stripe Open Source Retreat Grantees

    We received about 120 applications in total. Since we only had a few slots (we in fact were originally going to do two, but we had so much trouble choosing we ended up creating another slot), there were a large number of really awesome projects we had to turn away.

  • It's time for the US to use the metric system

    The United States is the last remaining industrialized nation with no formal commitment to going metric. America's position is causing unnecessary isolation. It's an impediment to trade and puts the United States at a disadvantage.

  • How Paypal and Reddit faked their way to traction

    A platform is useless without complementary products. Marketplaces, especially, are dead without sellers posting on them. To solve the chicken-egg problem, some marketplaces create fake supply to attract buyers.

  • I Sold My Startup for $25.5 Million

    When I shared the news, the team stared blankly at me, unsure if it was a good thing or a bad thing.


Links for May 29, 2014

posted by Alex Gorbatchev on May 29th 2014


  • Introducing Socket.IO 1.0

    The first version of Socket.IO was created shortly after Node.JS made its first appearance. I had been looking for a framework that easily enabled me to push data from a server to a client for a long time, and even had tried other approaches to server-side JavaScript.

  • Understanding web pages better

    … we decided to try to understand pages by executing JavaScript. It’s hard to do that at the scale of the current web, but we decided that it’s worth it. We have been gradually improving how we do this for some time. In the past few months, our indexing system has been rendering a substantial number of web pages more like an average user’s browser with JavaScript turned on.

  • browserify-handbook (GitHub: substack/browserify-handbook, License: cc-by-3.0) is a great resource for beginners and pros on organizing node apps and modules. Very good read.
  • Device State Detection with CSS Media Queries and JavaScript

    Being able to detect device state at any given moment is important for any number of reasons and so it's important that web app CSS and JavaScript are in sync with each other.

  • hapi hapi joi joi - fantastic slides!
  • Relay Control with Johnny-Five on Node.js


  • How much is your startup stock worth?

    You can’t get rich on salary.



posted by Alex Gorbatchev on May 23rd 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

Object validation is a tricky thing. It sounds pretty simple when you first think about it, yet there are a ton of libraries that try to do it. Why is that? I feel like there are just alot of way to approach the subject. Joi (GitHub: spumko/joi, License: BSD 4-Clause) is a schema validation library that came out of the Walmart Labs efforts and more specifically power validation in the hapi server framework.

Lets check it out!



posted by André König on May 23rd 2014

You fixed all the bugs, closed some security holes and documented new features in your project. In other words - you did a great job and the next release is ready for the roll-out. But you're not done just yet! No? What else? You have to update the changelog file, bump the version in the respective package.json and create a git tag first. Hm, many steps, right? No more! changelog (GitHub: defunctzombie/changelog, License: MIT) by Roman Shtylman is here to save you.


Links for May 22, 2014

posted by Alex Gorbatchev on May 22nd 2014


  • Add Rules to Stylesheets with JavaScript

    Another way we can make our pages efficient and fast is to dynamically add and remove styles directly to a stylesheet instead of constantly querying the DOM for elements and applying styles. Here's how it works!

  • Redis new data structure: the HyperLogLog

    There is a class of algorithms that use randomization in order to provide an approximation of the number of unique elements in a set using just a constant, and small, amount of memory. The best of such algorithms currently known is called HyperLogLog, and is due to Philippe Flajolet.

  • Script-injected "async scripts" considered harmful

    The script-injected pattern offers no benefits over <script async>. The reason it exists is because <script async> was not available and preload scanners did not exist back when it was first introduced. However, that era has now passed, and we need to update our best practices to use async attribute instead of script-injected scripts. In short, script-injected "async scripts" considered harmful.

  • Data-binding Revolutions with Object.observe()

    A revolution is coming. There’s a new addition to JavaScript that’s going to change everything you think you know about data-binding. It’s also going to change how many of your MVC libraries approach observing models for edits and updates.


Links for May 20, 2014

posted by Alex Gorbatchev on May 20th 2014


  • Gulp + Browserify: The Everything Post

    When I was done flipping tables, I set aside my newly acquired Grunt + RequireJS skills, and started over again with Gulp and Browserify to see what all the fuss was about.

    You guys. The internet was right. To save you some googling, doc crawling, and trial and error I went through, I've assembled some resources and information I think you'll find helpful in getting started.

  • Roll Your Own Asset Pipeline with Gulp

    Gulp is a build system. It’s like Grunt, Make, Rake, and the like. It’s easy to use for the person running it. While it does have a slight learning curve, you’ll find it a super useful tool for all kinds of tasks. It’ll be the fastest weapon in your toolbox for asset compilation (both in terms of time to develop and run time).

  • Chrome 35 launches with more developer control
    • More developer control over touch input.
    • New JavaScript features.
    • Unprefixed Shadow DOM.
    • A number of new apps/extension APIs.
    • Lots of under the hood changes for stability and performance.



posted by Alex Gorbatchev on May 19th 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

You know that feeling of disapointment when you get an error and the stack trace just abruptly ends and you know for a fact it should be much longer, and much more useful than that?

Error: Error message
    at null._onTimeout (/examples/error-module.js:7:29)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

I'm very well familiar with that feeling... Maybe too much? Turns out there's a way to get much better results in Node with a little bit of magic. Said magic is a module called longjohn (GitHub: mattinsler/longjohn, License: MIT) by Matt Insler.


Links for May 16, 2014

posted by Alex Gorbatchev on May 16th 2014


  • Introducing Firebase Hosting

    Once upon a time, in the dark ages of the internet, apps dynamically generated HTML server-side every time a page was requested. This was slow, difficult to scale, and required users to connect to distant servers to get their content.

  • Cookies vs Tokens. Getting auth right with Angular.JS

    What's JSON Web Token? JSON Web Token (JWT, pronounced jot) is a relatively new token format used in space-constrained environments such as HTTP Authorization headers.

  • Auth with JSON Web Tokens

    There’s a relatively new standard called JSON Web Token that happens to be backed by companies like Firebase, Google, Microsoft, and Zendesk. There are already many libraries to handle encoding and decoding of this tokens in the backend.

  • 100,000 e2e selenium tests? Sounds like a nightmare!

    If I had to choose just one, I would definitely choose a comprehensive suite of automated unit tests over a comprehensive suite of end-to-end/system tests any day of the week.

  • Lessons learnt by building Single Page Applications

    I want to share some of the lessons I have learnt building them, especially what things I found difficult technically. Based on my experience I think the following are common issues that you may encounter when building them.



posted by Alex Gorbatchev on May 6th 2014
This post was written for Nodejitsu blog and is crossposted here. Nodejitsu loved what I was doing at and is now supporting the project.

As you web application grows, there comes a time when you will want to have scheduled jobs. The easiest thing is of course go the cron route. However, maintaining and updating it isn't so easy, especially if you have more than one server to deal with and you still maybe too young for enterprise level job scheduler. What's left? Maybe just do some setTimeout calls in process... That doesn't sound very exciting nor very manageable.

This is where agenda (GitHub: rschmukler/agenda, License: MIT) by Ryan Schmukler comes in. agenda, to plainly put it, is a light-weight job scheduling library for Node.js. Lets give it a go!


Fork Me