Joined February 2012
·

Andreas Köberle

JavaScript Developer at Celeraone
·
Berlin
·
·
·

Posted to parseInt() can be dangerous over 1 year ago

@passcod, @mlb If you work with other your code should be easy to read and understand. Using + or >> to convert something into an integer is totally verbose. The right way would be to use parseInt always with the second radix parameter and lint your code.

I think the point was to create a DOM element without writing to much html. Maybe the example is a bit misleading.

@mechax Do you really edit files in production environment?

Posted to One-Div HTML/CSS icon database over 1 year ago

There a bunch of ways to save requests like dataUri embedded images in CSS, WebFonts or embedded SVG images. All this will work far better than this hack. Also changing the font size totally break the icons after two steps.

Posted to One-Div HTML/CSS icon database over 1 year ago

This seems to be a totally misuse of the content attribute. Cause there are better ways to display images then to tinker them out of boxes with rounded corners.

Note, you can also use --amend to fix typos or improve commit messages without committing any changed files

Ah, thanks for the clarification. Is your solution necessarily bound to chrome or would it work with other browser too?

Mhmm, seems your example will always return the full name.

Posted to ~~ is faster than Math.floor() over 1 year ago

Before you think about 'its faster' you should ask yourself if its worth. Take a look at the jsperf number on the slowest device Math.floor runs 3.5 millions ops/sec while ~~ runs 3.8 millions ops/sec. So sure it is faster but how often to you need a something that runs that often. The price for such mircro optimization is code that is hard to read for your coworkers.

Posted to Animating jquery knob to a value over 1 year ago

Thanks. Still working on it as the API isn't that nice yet.

Posted to A neat foreach-loop in Javascript over 1 year ago

You're missing the main point in your example: map returns a new array, so in your example items has still the same values as before. You have to assign the result of map to a new variable.

var items = [1, 2, 3, 4, 5];
var newItems = items.map(function(item) {
  // Do something with item
});
Posted to Animating jquery knob to a value over 1 year ago

Working an something similar: http://eskimoblood.github.com/jim-knopf/

Achievements
829 Karma
50,030 Total ProTip Views