Itsy Bitsy Bytes


Code and stuff
on javascript

Javascript's scoping got me

When programming, I often use a pattern like this one: var myDefaultVariable; for (var key in object) { myDefaultVariable = myDefaultVariable || getOtherVariable(); // do stuff } The code above is not an exact form and it's something I use mostly when I have an original value that needs to be determined only for first
Read More
on javascript, css

When animationEnd is not fired

I ran into a problem today with an animated action. It was part of a queue and the next command was triggered from inside the animationEnd callback. The animations I was using were made with CSS classes and detecting the animation completion with Javascript was a much more elegant and
Read More
on web

The Web Developers' superpowers

Just like Superman has flying, super-strength and X-Ray vision, the Web Developers have a superpower of their own, much like Batman's amazing toolbelt. This superpower is the browser console. At work (and most of the times at home), I have at least one tab with the developer's console open. Besides
Read More

Fizz Buzz golfing

A colleague of mine came to me recently and gave me the following link, telling me to try the single challenge and make it as small as possible. It contained the classic Fizz Buzz problem. I whipped a rather standard JavaScript solution, which passed the site's verification with flying colors
Read More
on ghost

Different and the same

If there’s one thing I miss about the old Wordpress blog it’s the simplicity in troubleshooting. Fixing any errors about the site usually required editing some .php files and then reloading the browser until everything turned out to be fine. Today I tried to update my other Ghost
Read More

Browserify is useful

During the React tutorial presented in the previous post, I got a good taste of Browserify and so far it's the first tool of its kind that I found personally useful. Browserify helps with the module management, using npm, and can also to other useful transformations to the source file
Read More