David Corbacho

JavaScript

Debounce and Throttle: a visual explanation

Debounce and throttle are two concepts that we can use in JavaScript to increase the control of our function executions, specially useful in event handlers.

Both techniques answer the same question "How often a certain function can be called over time?" in different ways.
Let's explore them.

DrupalCon Munich highlights and Backbone.js

I landed in Munich, jumped in the first cab I saw and I started to talk with the friendly Turkish taxi driver that had a rusty English. After some laughs I told him that was my first time in Munich, and he replied:

"You good man, so I tell you: Never say to taxi driver is your first time in city. He make circles and bamm.. 150 euros. No no no". And with this lesson started my DrupalCon Munich experience.

Javascriptocalypse

What's happening? How is possible jQuery is overtaking JavaScript in Google popularity [number of searches] ?
The world will now implode on itself ?

JavaScript defined by the ECMA-262

There is a lot of JavaScript articles teaching the basics of JavaScript and its prototype-based inheritance, but many of them result confusing.
Surprisingly, I found much better explained and easier to grasp JavaScript prototypes in the ECMA-262 specification. (download the spec ECMA-252 5.1 here in pdf )

I don't like the name ECMAScript. As Brendan Eich, the creator of JavaScript, commented once: “ECMAScript was always an unwanted trade name that sounds like a skin disease.

"Time ago" date format in Drupal

The time ago format it's known as fuzzy timestamp, and they were popularized some years ago specially by Facebook and Twitter.

QR Codes on the fly with JavaScript

Let's go through some steps to create dynamically a QR Code of the current URL a user is visiting. The Google API will be used to generate the QR code and optionally using Google Analytics to track the use of it.

Syntax Highlighting in Drupal

Syntax highlighting improves the readability of the code.

There are multiple ways to add this feature to Drupal, so there is no excuse to mistreat your readers. Let's go through some solutions for syntax highlighting, dividing them in server-side and Javascript solutions. See the conclusions at the end.