2011.10.26

RequireJS plugins

One of the greatest advantages of the AMD module format over the other standards is that it supports loader plugins, which can be used to load other kinds of resources besides JavaScript, it can be a really useful feature and a nice way to abstract some simple behavior, it increases the loader flexibility a lot…

I just pushed to Github all my RequireJS plugins - if you don’t know it yet, RequireJS is an awesome script loader which can improve code organization a lot if used properly - so far I have plugins for loading images, JSON files (automatically parses JSON response), JSONP / asynchronous scripts (like Google Maps) and also script files without appending the “.js” file extension (useful for dynamic scripts). I will create new plugins as needed.

Watch the project on Github & fork it. Please use the Github issues to report bugs and also for features request.

Related


2011.10.25

amd-utils : modular JavaScript utilities

Last week I decided to split some of my personal JavaScript code into individual modules to provide an easy way of loading only what is really necessary and increase code reuse between multiple projects/libraries. The purpose isn’t to replace Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common problems that aren’t solved by most of them and to avoid using a full library when you only need a small subset of features.

The project is on github and I will keep adding new features as needed, there is still a lot of stuff to be ported from my legacy JS/PHP/AS3 code and also to be coded from scratch…
Read more…


2011.10.20

JavaScript chaining and Trainwreck.js


source images from public domain (1, 2) and edited by Miller Medeiros

Yesterday I released a piece of code that I wrote a long time ago, it’s called trainwreck.js and it’s main purpose is to provide easy method chaining.

The main reason behind it is because a lot of people don’t really understand how chaining works and end up extending jQuery or underscore.js just to be able to use chaining…

Read more…


2011.10.06

statline : Improved Vim statusline

I switched to Vim a few months ago and been reading other peoples’ settings and trying to customize it to my needs since then. Yesterday I couldn’t sleep so I decided to write my first simple “plugin” (not really a plugin, just a few settings..), it adds some cool/useful features to the vim statusline.

Here is a basic screenshot:

One of the advantages is that it adapts to the color scheme without needing any extra settings (but you can customize it easily if needed). The source code have enough comments and is split into individual blocks making it easy to add/remove things if you need. It also checks for trailing white spaces and mixed indention. (optional)

For more info check the project repository on Github and read the documentation. Please report bugs and feature requests though github issues.

That’s it!


2011.09.30

AMD is better for the web than CommonJS modules

I’ve seen a few libraries and tools later using different kinds of ways to
handle dependency management, some of them are very similar to the way that
CommonJS modules looks like:

Read more…