Link

Nobody seems to be happy, nobody seems to understand it … everyone is trying to change it, pretending to make it better … and again, nobody seems to realize it has been here since ever, it has been working in any field, it does everything, and it keeps getting faster!

On a related note, see All Right, Gentlemen!.

TypeScript

Link

Prism is a new lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.

(Source: lea.verou.me)

Video

Why, hello!. I’m Yeoman - a robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.

Looks promising:

  • Scaffolding (HTML5 Boilerplate, Twitter Bootstrap, AMD / RequireJS, tests…)
  • Build process with auto-compilation (CoffeScript, Compass), minification, optimization (HTML, images), generation of app cache manifest…
  • Package management yeoman install jquery FTW
  • Auto-Lint
  • PhantomJS unit testing
  • Built-in preview server

(Source: twitter.com)

Link

LiveScript is a language that compiles to JavaScript. It’s just JavaScript with some syntax improvements and feature additions, making functional style programming easier.

prelude.ls is a JavaScript library (written in LiveScript) which provides a rich set of functions to assist in functional style programming. It is somewhat based off of Haskell’s Prelude module. It’s the recommended base library for LiveScript, but will work with vanilla JavaScript as well.

Also: those LiveScript One Liners to give you an idea…

[1 2 3] |> map (* 2) |> filter (> 3) |> fold1 (+)
Quote
"Use document.addEventListener('touchend', function(){}); to enable :active on mobile"

(Source: twitter.com)

Link

HTML included (!), uses <canvas>.

Link

A presentation made at SXSW 2012. Clicking on the slide links to see actual jsPerf tests is recommended.

Text

Efficient accent folding in JavaScript

Accent folding, or diacritics removal, aims to replace accented letters with their English alphabet base (which is different from normalized Unicode equivalence). It has several common applications. For example:

  • sorting, simple implementation as well as certain collating sequences
  • indexing and search, auto-complete, text expansion
  • URL slugs, code names, tags…

Accent folding has been well covered with some use cases like auto-complete by Carlos Bueno in this article for A List Apart, so I’ll skip further “why”s and concentrate on the “how”.

I needed to remove diacritics for sorting list items. And I wanted a fast implementation that could run often (and/or on the client side, possibly in IE) on lists with a few hundred strings.

A search led me to this implementation which uses regexes. So I took his character map and rewrote my own which doesn’t, and ran some basic performance tests. As expected, avoiding regex performs better.

It is pretty basic, see the code on Gist:

  1. split the string into an array of characters
  2. for each characters, if there is a match in the map, then replace it with the corresponding value (and set a flag)
  3. if the flag has been set, join back the array into a string, else just return the input string

After, I found about the ALA article and realized that I had taken almost the same per-character approach as the author, except that he used a string in which he adds characters, while I use an array. For the sake of completeness, I added it in the performance tests (hint: adding to string is slower).

Also, in my implementation, I’m using hasOwnProperty to check the presence of the character in the map, thus avoiding the side-effect of (unlikely yet possible) third-party code messing with Object.prototype (more on that, see An Object is not a Hash).

Link
Link

(Source: twitter.com)