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.08.18

Convert YUI Test to Jasmine

I decided to port some of my old YUI Test tests to Jasmine yesterday (specifically JS-Signals and Crossroads.js tests) and realized that a big part of the process could be automated by using simple regular expressions, so I decided to create a tool to help me.

The main reason for switching from YUI Test to Jasmine was that I wanted to run the tests on node.js and also to be able to run the tests without needing an internet connection… Another reason for the switch is because I like Jasmine syntax and I think that the simple fact of describing what you want the code to do makes you think about possible edge cases.

I coded the tool very quickly just to help me on the bureaucratic process… It doesn’t do any magic but can help you to speed up the process.

You can use the tool online at: http://millermedeiros.github.com/YUI_to_Jasmine/.

Maybe it is useful to somebody else…

That’s it!


2011.08.08

Hasher: deep linking for rich-media applications

Hasher Logo

There are many available polyfills and libraries that provides deep-linking capabilities using the browser location.hash to generate a new history state. Hasher was created to do exactly the same thing but providing a cleaner API and solving a few problems present on some of the other libraries, it was also designed to make use of JS-Signals providing many advanced features like enabling/disabling the event dispatch, adding multiple listeners, etc… and to also be used together with Crossroads.js easily.

Check the README file on the project repository to understand better how does it work, why it was created, some benefits over the other solutions and also when should you favor using the HTML5 history API over location.hash to store application state and when you should avoid it.

Watch the project on Github for future updates and use the issue tracker to report bugs and ask for new features, contributors are welcome!

PS: I’ve been using Hasher for more than 1 year on a few projects but only decided to release it last week (after revising API and refactoring unit tests).

Related Posts:


2011.05.19

Crossroads.js: JavaScript Routes

The project isn’t that new anymore and was already featured on a couple places but I think I should also create a post just in case someone missed it and also to register the release.

Crossroads is basically a routing system used to map strings to functions (usually URL fragments), it acts similar to a pub/sub (event listener) but uses Regular Expressions and dynamic string patterns to identify listeners. The main feature is the robust and flexible string validation/match/parsing system.

The greatest advantage of Crossroads when compared to other similar libraries is that it is not directly tied to server requests (in case you are using it on the server-side) or to the window.location (if you are on the browser). Another important advantages are the flexibility and the support for advanced use cases, provided by different kinds of validation rules and multiple listeners to each route. – It gives you flexibility to do any kind of action you want and doesn’t do anything you don’t ask it to do.

Check the project page and examples to know more about it. It can be specially helpful for large websites and single page apps – as I mentioned on my previous post.

I hope you enjoy, contributors are welcome.


2010.11.28

JS-Signals: Custom event/messaging system for JavaScript

I’ve just released a new open source project called JS-Signals. It’s an event/message system similar to pub/sub and DOM2 Events but that doesn’t rely on strings to broadcast/subscribe to events, it has also some extra features that usually aren’t available on the other systems.

JS-Signals was heavily inspired by Robert Penner’s AS3-Signals but it is NOT a direct port, which means it has a different implementation and features. I’ve also stolen borrowed a few ideas from Joa Ebert fork ;).

Make sure you read the comparison between the different event systems and the usage examples.

Download it and get more info at http://millermedeiros.github.com/js-signals/.

Ideas and contributors are welcome!