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?
There is also git rebase --interactive --autosquash
: http://technosorcery.net/blog/2010/02/07/fun-with-the-upcoming-1-7-release-of-git-rebase---interactive---autosquash/
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.
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?
There are also some grunt plugins for this:
Mhmm, seems your example will always return the full name.
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.
Thanks. Still working on it as the API isn't that nice yet.
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
});
Working an something similar: http://eskimoblood.github.com/jim-knopf/
@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.