platform.js

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

There are plenty of different runtime environments in JavaScript-land. Whereas this is a good thing there are also situations where the fragmentation is hindrance. Situations in which your application has to gather information about the platform it is running on. This is where platform.js by John-David Dalton and Mathias Bynens comes to the game.

Continue...

Links for Apr 23, 2014

posted by Alex Gorbatchev on April 23rd 2014

André König

I'm happy to welcome André König to npmawesome! Very excited to publish his first post about platform.js! Coming from Bremen, Germany, André is very active on NPM and better known for angular-deckgrid, imacss as well as a whole bunch of gulp.js modules. Woot!

Articles & Slides

  • Tim Caswell on history of Node.js callbacks

    Shortly after node was made, the concept of the event emitter was added. We didn't have the current callback-last style, but had a convention that non-blocking functions would return a special emitter known as a "Promise".

  • Faster AngularJS Rendering (AngularJS and ReactJS)

    Have you used AngularJs and ran into some performance problems? Using ReactJs rendering becomes much faster. A small examples explains how to use ReactJs for rendering in AngularJs and a comparison is made between native rendering and rendering using ReactJs.

Continue...

Links for Apr 19, 2014

posted by Alex Gorbatchev on April 19th 2014

Articles & Slides

  • Build a RESTful API Using Node and Express 4

    With the release of Express 4.0 just a few days ago, lots of our Node apps will have some changes in how they handle routing. With the changes in the Express Router, we have more flexibility in how we can define the routes for our applications.

  • Controlling an Arduino with NodeJS and Johnny-Five

    Firmata and Johnny-Five make it a lot easier for JavaScript developers to get more involved and develop applications that can interact with, respond to and control Arduino powered technology.

  • Brunch - A build system without the Grunt-work

    Brunch compiles, concats and (optionally) minifies your scripts and styles. It can also package JavaScript files into AMDor CommonJS modules. Brunch automatically applies plugins in the correct order to the right files - so with the right plugins, a .coffee file would be converted into a .js file and then minified, with no explicit setup necessary.

Continue...

Links for Apr 18, 2014

posted by Alex Gorbatchev on April 18th 2014

Articles & Slides

  • Lens Blur in the new Google Camera app

    Having computed the depth map, we can re-render the photo, blurring pixels by differing amounts depending on the pixel’s depth, aperture and location relative to the focal plane. The focal plane determines which pixels to blur, with the amount of blur increasing proportionally with the distance of each pixel to that focal plane. This is all achieved by simulating a physical lens using the thin lens approximation.

  • Controlling an Arduino with NodeJS and Johnny-Five

    This video aims to help those new to Arduinos and NodeJS understand the basics of getting started. I’ll provide an overview of what you’ll need to do in order to get a Node application speaking to an Arduino using the Johnny-Five JavaScript framework. By the end we will have used the power of JavaScript to turn an LED light on and off!

Continue...

terminal-menu

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

Lets continue building out awesome CLI (command line interface) tool. Previously we have discussed how to take in command line arguments, output tabular data and display progress of long running tasks.

Prompting a user with options and asking to pick one is a fairly common scenario. Most of the time you get to read the options and press associated key. That works, but we are human and like pretty interfaces. Same thing can be achieved with a common menu interface. This is where terminal-menu by James Halliday comes in.

Continue...

Links for Apr 17, 2014

posted by Alex Gorbatchev on April 17th 2014

Articles & Slides

  • How Burrowing Owls Lead To Vomiting Anarchists (Or SF’s Housing Crisis Explained)

    Homeowners have a strong economic incentive to restrict supply because it supports price appreciation of their own homes. … Then the rent-controlled tenants care far more about eviction protections than increasing supply. That’s because their most vulnerable constituents are paying rents that are so far below market-rate, that only an ungodly amount of construction could possibly help them. Plus, that construction wouldn’t happen fast enough — especially for elderly tenants.

    So we’re looking at as much as 80 percent of the city that isn’t naturally oriented to add to the housing stock.

  • Ubuntu 14.04 LTS: the cloud platform of choice

    Canonical today announces Ubuntu 14.04 LTS will be released on 17th April 2014, bringing a new level of reliability, performance and interoperability to cloud and scale out environments with support and maintenance for five years.

  • Cracking Cloudflare's heartbleed challenge

    … it won't produce any result immediately, it took me 3 hours and a certain amount of luck to obtain the key in a Cloudflare's challenge.

  • Introduction to A*

    Movement for a single object seems easy. Pathfinding is complex.

  • 12 Web Application Frameworks for Node.js

  • Tails is a live operating system, that you can start on almost any computer from a DVD, USB stick, or SD card. It aims at preserving your privacy and anonymity.

Continue...

Comparing Node.js Promises, Try/Catch, Angular Zone.js and yes, Zone

posted by Alex Gorbatchev on April 16th 2014

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

Handling errors in async flow

In the previous article we've talked about managing async flow and escaping the callback hell.

The problem

Handling errors in asynchronous flow is pretty straightforward and easy. Handling errors in asynchronous flow in a clean and easy to follow manner - not so much.

Lets look at the following code:

function updateDependencies(packageName, done) {
  findPackage(packageName, function(err, content) {
    if (err) {
      done(err);
    }
    else {
      try {
        package = JSON.parse(content);
      }
      catch (e) {
        done(e);
      }

      findDependencies(package, function(err, dependencies)) {
        if (err) {
          done(err);
        }
        else {
          processDependencies(dependencies, function(err) {
            if (err) {
              done(err);
            }
            else {
              done(null, dependencies);
            }
          });
        }
      });
    }
  });
}

We are covering all possible failure cases here using combination of try/catch and callback error handling, but boy do we repeat ourselves over and over again. Lets try and rewrite this!

Continue...

Links for Apr 15, 2014

posted by Alex Gorbatchev on April 15th 2014

Articles & Slides

GitHub

  • Box <3 Open Source. Our open source projects represent the best of Box. They are all hosted on GitHub. We hope you'll find them helpful and we invite you to contribute.
  • Avow CI is a simple yet powerful open-source CI system for individual developers, small teams and dev shops, specifically designed for JavaScript projects.

Startups

  • Red Pen is the fastest feedback tool for visual teams.

Continue...

Links for Apr 10, 2014

posted by Alex Gorbatchev on April 11th 2014

Articles & Slides

  • Write Code Every Day

    Minimum viable code. I was forced to write code for no less than 30 minutes a day. (It’s really hard to write meaningful code in less time, especially after remembering where you left off the day before.) Some week days I work a little bit more (usually no more than an hour) and on weekends I’m sometimes able to work a full day.

  • Docker-powered Runnable Gists

    There are a number of ways of achieving each of these objectives (virtual machines, chroot, cgroups, etc), but Docker emerged as a pretty great solution that covers each of the points mentioned. Built on LXC and cgroups, it enables creation and teardown of relatively secure sandboxed environments in a fraction of a second. Each time a code snippet is run, a docker container can be created, started, used to run the untrusted code, then killed and destroyed. It’s incredible that all this can happen in a matter of milliseconds.

  • JS Everywhere - My First Conference Talk

    I started working on this 15-minute talk about a month ago and that felt like the right amount of time. The talk went through several incarnations as I got feedback from a number of different people. Fairly early on I knew that I wanted to argue that code is fashion but in early talks, someone pointed out to me that I was really saying that fashion is nothing but fads. That was great feedback and because I still had quite a bit of time I was able to think about it and come to a better understanding of what fashion means to me.

  • Debugging Clustered Apps with Node-Inspector

    Debugging a clustered Node application is not without some idiosyncrasies, particularly if you are running Node v0.10. But, it does work well enough if you understand what’s going on behind the scenes. Now, before you embark on this debugging adventure, you should probably ask yourself, “Can I run my app un-clustered and debug it in that mode or is the issue I am trying to track down, only seen when running my app in a clustered configuration?”

  • Why are people from the future not time traveling to our period?

    So the likely reason that time travelers from the future aren't visiting our period is (other than time travel perhaps being physically impossible) that we're just not that interesting, and we're not really that large. It's only temporal-centric egotism that makes us believe otherwise.

  • JSJ Robots with Raquel Vélez Podcast

GitHub

  • Kiwi IRC makes Web IRC easy. A hand-crafted IRC client that you canenjoy. Designed to be used easily and freely.
  • Famo.us provides a powerful JavaScript framework and developer tools designed to build rich, fast web applications. Famo.us takes an opinionated approach to developing with web technology, maintaining tight control of rendering to achieve maximum UI performance. Check out the demos.

Continue...

shmock

posted by Alex Gorbatchev on April 10th 2014

shmock is a module by Jonathan Leibiusky provides a super nice API, like the one of superagent but it creates a real http server (using express). The nice thing about this is that you don't really care about the implementation, which http client is being used, or even if nodes native http api changes.

Continue...

Links for Apr 8, 2014

posted by Alex Gorbatchev on April 9th 2014

Articles & Slides

GitHub

  • ource-map-visualization for various flavors. Pretty cool to see how the mapping works.
  • angular-strap - AngularJS 1.2+ native directives for Twitter Bootstrap 3.
  • flag-icon-css - CSS for vector based country flags.
  • oculus-drone - Oculus Rift + AR Drone 2.0 controller with live video feed and head-motion controller written for Node.js in CoffeeScript.
  • node-fluent-ffmpeg abstracts the complex command-line usage of ffmpeg into a fluent, easy to use Node.js module.
  • Jasper is an open source platform for developing always-on, voice-controlled applications.

Startups

  • Slack brings all your communication together in one place. It’s real-time messaging, archiving and search for modern teams.
  • ZeroCater is the easiest way to feed your team.

Vidoes

Links for Apr 7, 2014

posted by Alex Gorbatchev on April 7th 2014

Articles & Slides

  • Email transparency at Khan Academy

    Whenever we mention that almost all Khan Academy email is visible to everybody on the team, people always wanna know more... Here’s the how and why of “radical email transparency” at Khan.

  • S.F. cracks down on Airbnb rentals

    As Katz discovered, San Francisco's ban on short-term rentals is turning out to have teeth. People who rent out space on Airbnb, VRBO and other markets for temporary housing are facing fines by the City Planning Department and eviction on the grounds of illegally operating hotels.

  • Link a tablet to your meeting room calendar

    They reasoned that by linking our online calendars to a tablet mounted neatly next to the door, it’d be much easier to see, at a glance, whether the room was being used - without poking your head in and possibly interrupting someone.

  • The Single Most Sure-Fire Hiring Decision You Will Ever Make

    “One good way to snag the great people who are never in the job market is to get them before they even realize there is a job market: when they’re in college.” All the way back in 2006, Joel Spolsky knew that a competitive and rewarding internship program was the best way to acquire top engineering talent. Yet even in 2014, in the midst of a talent crunch, surprisingly few technical companies have internship programs.

  • A Tip for Angular Unit Tests with Promises

    tl;dr: Don't put assertions inside promise callbacks.

GitHub

  • Open Red Alert - I played this game to death when it came out originally. Crazy that somebody's rewriting it in C# (mono).
  • ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
  • JavaScript GitBook - teaching programming basics with JavaScript.
  • iHover is an impressive hover effects collection, powered by pure CSS3, no dependency, work well with Bootstrap 3!

Services

  • Keybase will be a public directory of publicly auditable public keys. All paired, for convenience, with unique usernames.
  • ASCIInema - record and share your terminal sessions, the right way.

Misc

Continue...

Links for Apr 5, 2014

posted by Alex Gorbatchev on April 4th 2014

Apps

  • Ghost is an Open Source application which allows you to write and publish your own blog, giving you the tools to make it easy and even fun to do. It's simple, elegant, and designed so that you can spend less time making your blog work and more time blogging.

Articles & Slides

GitHub

Startups

  • Shyp is the easiest way to ship anything.
  • Spoon Rocket is the most convinient meal ever.

Misc

Continue...

progress

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

Lets talk about long running CLI (command line interface) applications. When you have a finite process that is expected to take some time, the best thing to do is to let your users know about it. A typical application that for example downloads a file might look like this

var
  request = require('request'),
  fs = require('fs')
  ;

process.stdout.write('Downloading... ');

request('http://nodejs.org/dist/node-0.0.1.tar.gz')
  .pipe(fs.createWriteStream(__dirname + '/node.tar.gz'))
  .on('close', function (err) {
    process.stdout.write('done!\n');
  });

The user experience is hardly a great one. It's clear that something is happening, or at least expected to be happening.

Continue...

Links for Apr 4, 2014

posted by Alex Gorbatchev on April 3rd 2014

NPM Inc

Apps

  • Koala is a GUI application for Less, Sass, Compass and CoffeeScript compilation, to help web developers to use them more efficiently. Koala can run in windows, linux and mac.
  • Zed is a fully offline-capable, open source, keyboard-focused, Chrome-based text and code editor you can use to edit local files as well as remote files on any server.

Articles & Slides

GitHub

  • mucuchies - A neat looking pluggable client-side dashboard.
  • parallax - Parallax Engine that reacts to the orientation of a smart device.
  • KOAN stack (Koa, Angular, Node, Mongo, WebSockets) for real-time full-stack JavaScript web development.

Misc

  • forecast.io weather API is open and has a pretty high free rate limit.
  • Crypto 101 is an introductory course on cryptography, freely available for programmers of all ages and skill levels.
  • GitBook is a webapp to build beautiful programming books and exercises using GitHub/Git and Markdown.

cli-table

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

In this post we continue the small mini-series of posts about modules for writing CLI (command line interface) tools in Node.js. In the first post we talked about parsing arguments supplied via the command line.

One of the more interesting subject when it comes to writing CLI tools is how do you present data back to your users. Assuming you need to spit out bunch of tabular data, the standard way of doing that would be in a CSV format (comma separated values). This generates output that other programs can easily parse, but most of the time it's pretty incomprehensible for humans. It's a good idea to be nice to your users and give them an option for a pretty format, eg with --pretty flag.

Continue...

yargs

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

This post kicks off a small mini-series of posts about modules which making writing CLI (command line interface) tools in Node.js easier. Typically, when starting a new CLI tool, the first problem that you would encounter is how to read arguments that users pass via command line. Standard library gives us process.argv but if you want something a little bit more structured than an array, you have to look elsewhere.

Continue...

convict

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

Managing application configuration is one of the cornerstones to a reducing stress that comes from deploying Node.js applications to production environment. It's pretty easy if all you have to worry about is the port that your web server is listening on and database connection. But what do you do when you have a dozen or so external services, local folders, multiple connections and so on to have to keep track? And to top it off, all of this varies across development workstations, staging and production.

Continue...

lockit

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

So you got a really cool idea for an app or a service. You get all fired up, talk to your friends about, write down some bullet points and run that exciting git init command in an empty folder. One of the first things you are most likely to in the very near future is begin working on some kind of user login and registration process.

Continue...

Fork Me