IT IS HERE! Get Smashing Node.JS on Amazon Kindle today!
Show Posts
← Back to homepage

At LearnBoost, I wrote a project that sits on the intersection between two of my passions: code and education.

The basic premise is that with one command you can stream your terminal to the world, and record it as a video for later. You can make lessons interactive by streaming and chatting at the same time.

Check it out: http://codestre.am!

I just created a module named console-trace that does one very simple yet very useful thing: prepend the line number and filename to console calls.

To leverage it you just need to require('console-trace') and prepend a flag:

console.trace.error('Test');
console.t.log('Test'); // shorthand

You can learn about a few other options in the GitHub repository.

I’m very proud to announce JSConf.ar, the first of its kind in South America! Check out our website and sign up to learn when the first tickets will be on sale (follow us on Twitter as well!).

We’ve confirmed a gorgeous venue that will host our 2-day event on May 19th and 20th. Expect to not just learn from the best international and local speakers, but to take home an unforgettable experience. We are bringing all the excitement and energy from JSConf US and JSConf EU here to Argentina.

I want to thank Chris Williams, Mikeal Rogers & the whole JSConf gang for encouraging me and helping me take this event to my home country. On this end, none of this would have come together without Vulsai, a great local media agency who met this idea with great enthusiasm and reached out to help.

Nos vemos pronto!

During my search, I found two interesting patents on a process which is mathematically impossible: compression of random data.

Jean-loup Gailly, Author of Gzip on software patents

Last night I wrote a tiny up middleware to enable zero-downtime reloads of the code that powers your HTTP server whenever you push to a GitHub repo: up-hook.

Back when I introduced the project, I mentioned that it could be used both from the CLI and programmatically. The advantage of the latter, of course, is that since up is a layer of abstraction on top of distribute, one can write middleware that can alter its behavior.

For those not familiar with post-receive hooks, the concept is pretty simple: you set up a URL that GitHub sends a HTTP POST request to every time you push to the repository.

Its usage is really straightforward:

srv.use(uphook('/super-secret-url', { cmd: 'make deploy' }));

By default, it’ll capture hooks to the branch master and execute the given cmd, which defaults to git pull. All there’s left to do is to configure your GitHub repository:

You can find this in your project administration

As usual, head to the GitHub page for more information. You can find the project as up-hook in NPM.

I rarely have the need to generate man pages for a project, but I realized they could be useful for spot(1). For those situations, the solution by TJ Holowaychuk is one curl and handy Heroku-hosted web service away:

curl -s -F page=@file.md http://mantastic.herokuapp.com > file.1

In my computer and slow connection at home, it took 1 second to run this task as measured by time(1). Not bad for something that was already in my computer (curl), that prevented me from needlessly having to run the easy_install/npm/gem/brew/package manager of the day.

As a matter of fact, while installing a Python CLI utility the other day, I pressed tab to autocomplete and was met with a few options:

∞ easy_install
 easy_install      easy_install-2.5  easy_install-2.6  easy_install-2.7

The reality is that a lot of the tools we use or could be using in our terminals could be run somewhere else, and their installation could consist in setting up an alias in your bash profile. Do you need to do syntax highlighting but don’t care for installing a bunch of things?

alias pygmentize="ru pygmentize"

My suggestion here is the creation of a ru command (codename remote unix) whose job would be to provide the same interface as the original command, but execute it remotely. If you pass it -h to get help, it takes that to the web service and outputs its response.

Other examples of potentially useful cloud-run tasks include any text compilers (eg: mantastic, markdown, textile), file type conversion and manipulation (eg: png2gif, trimage), and more.

About Guillermo Rauch:

CTO and co-founder of LearnBoost, developer, open source enthusiast, blogger.