Navigating an AMD codebase in Sublime Text using Static Analysis and Node.js

As your JavaScript codebases grow, it can be difficult to stay productive within your editor. Whether you are looking for modules that require the current module or simply trying to hop between dependencies; most tasks related to navigating a large codebase require numerous steps that become tedious and can seriously hinder productivity.

Behance engineer, Joel Kemp, writes about how he used static analysis techniques via Esprima and Node.js to overcome these problems within Sublime Text 3. Check out the post: Navigating an AMD Codebase in Sublime Text.

Bēhance Dev Links Issue 01

World cup results for hackers. Uses Soccer For Good API

Nothing like getting sports scores and info in your Terminal!


submitted by Rachel White


“Statistical Renaming, Type Inference and Deobfuscation”


submitted by Joe Sepi

Create a TV Show Tracker using AngularJS, Node.js and MongoDB

An introduction to full-stack javascript development that uses express on the backend, mongodb for data storage, and AngularJS on the client.

submitted by Sean Dunn

Colorize log files on CentOS and Ubuntu using ccze tool

Even though you might be using centralized logging tools like Splunk, Logstash, or Sumologic, occasionally you just want to go in and tail a log yourself. Ccze is an awesome, custom-color formatting tool that makes the arduous task of reading/searching through logs a little more pleasant.


submitted by Malcolm Jones Read more →

JavaScript MVC: Inheritance

If you’ve ever done a lot of JS development you might find the following situation familiar: you’re loath to open up the bowels of the sweet webapp you wrote because you know inside you will find hundreds of lines of jQuery selectors stacked on top of each other. Try as you might, they just won’t be tamed simply by separating out into distinct functions. Soon you’re lost in your own code, trapped in a Borgesian labyrinth of your own making.

That was one of the first challenges we ran into when I started working at Behance: the decentralized, deframework-ized nature of the client side code. Like many other shops, JavaScript was viewed with equal parts suspicion and distaste. But as our code grew, it became increasingly impossible to continue working the same way as thousands of lines of JS collided tectonically into each other as Everests grew out of merge conflicts.
Read more →

Emulate Backbone Events with jQuery 1.7 $.Callbacks

I just started the fun upgrade process from jQuery 1.6 to 1.7 across our apps. One of the things that’s been missing from jQuery for a long time are non-DOM based events. In places where I needed them, I took the bind/unbind/trigger methods from Backbone.js.

Now $.Callbacks enters the room with a standing ovation. It lets developers control lists of callbacks that will all fire at once. For example you can create

// Register list
var cartUpdated= $.callbacks();

// Add callback1 to list
cartUpdated.add( callback1 );

// Add callback2 to list
cartUpdated.add( callback2 );

// Fire so both callbacks run "quantity", "price" );

What I find is that this syntax is very powerful in most basic cases with one file. It becomes too coupled once more than one file is introduced though. To alleviate the coupling problem, I have created a small singleton, Events. The full singleton code is a gist here. The idea is that Events wraps fire/add/remove with trigger/bind/unbind to get the power of traditional DOM-related events. For instance I can trigger any event on an element at any point, without worrying if anything was bound or created beforehand. $.Callbacks doesn’t natively allow that. As you saw above, you need a reference to “cartUpdated.” This singleton allows for that blind firing that proves useful in many cases.

Read more →