HNHacker News
TopNewBestAskShowJobs

mathias

3,588 karma · joined December 26, 2009

Web standards enthusiast. https://mathiasbynens.be/
submissionscomments
mathias··on JavaScript has a Unicode problem (2013)
Excellent point. I was aware http://mathiasbynens.be/notes/javascript-unicode#accounting-... is not a fully accurate/bulletproof solution (never said it was, either). I’ve added a note to the article now, linking to UAX#29. Thanks!
mathias··on JavaScript has a Unicode problem (2013)
The article mentions several examples of real-world issues (in popular libraries etc.) that stem from this behavior. Writing a regular expression to match a single symbol sure seems easy until you realize some characters have a length of `2`, not `1`, in JavaScript (and some other languages).
mathias··on JavaScript has a Unicode problem (2013)
Exactly. I wrote a separate post on that: http://mathiasbynens.be/notes/javascript-encoding
mathias··on Stop writing For loops. Start using underscore.
Another example is:

    _.forEach(array, function(item) {
      doSomething();
      if (condition) {
        // exits iteration early
        return false;
      }
    });
This is just not possible with native `Array#forEach` – you’d have to use a plain `for` loop with a conditional `break` statement instead, or rewrite your code to use `Array#some`.
mathias··on CTF3 architecture
For level2 you could also implement load balancing pretty easily. See my write-up: https://github.com/ctfs/write-ups/tree/master/stripe-ctf3/le...

Would you mind sharing the code to your solutions as gists so we can link to them from the write-ups repository? You got some very nice scores.

mathias··on Stripe-CTF 3 Writeup
Added a link to your write-up and solutions to the collection here: https://github.com/ctfs/write-ups/tree/master/stripe-ctf3
mathias··on Bashstrap – For your OS X terminal
That was added after posting it here. https://news.ycombinator.com/item?id=6951288
mathias··on Bashstrap – For your OS X terminal
Indeed, looks like Bashstrap is a fork of my dotfiles (without giving any credit, sadly). A lot of the commands, file structure, and even parts of the readme are a direct copy-paste.
mathias··on Bashstrap – For your OS X terminal
Actually, it looks like Bashstrap is a fork of https://github.com/mathiasbynens/dotfiles. A lot of the commands, file structure, and even parts of the readme are a direct copy-paste…
mathias··on The string type is broken
> stuff would start breaking for characters outside of the BMP (which is where JS is still stuck at, btw)

ECMAScript 6 fixes that, mostly. See http://mathiasbynens.be/notes/javascript-unicode for details.

mathias··on The string type is broken
The article briefly mentions JavaScript, which uses something similar to UTF-16/UCS-2: http://mathiasbynens.be/notes/javascript-encoding>

Here’s a slightly more in-depth blog post on the many issues this causes, and how to avoid them in JavaScript: http://mathiasbynens.be/notes/javascript-unicode Some of these problems are briefly mentioned in the above post, too.

mathias··on Why I'm Planning to Kill W3Schools
http://www.w3fools.com/
mathias··on Why you should not trust emails sent from Google
Some more points:

3. Since these emails are sent by the Google Scholar back-end, through Google’s legitimate servers, such a phishing mail would be more likely to bypass email client spam filters (compared to, say, an attacker registering google-scholar-hax.net and sending phishing emails from there).

4. The affected emails would still have Google’s DKIM email signature, proving that it was sent by Google (which would be impossible from a custom attacker-controlled domain). In other words, an attacker could send an email containing any HTML he wants, to any academic email address, and Google still puts a stamp on it saying “this is legit”.

mathias··on No HTML needed
See http://mathiasbynens.be/notes/css-hidden-elements
mathias··on No HTML needed
Any chance you were you thinking of http://mathiasbynens.be/notes/css-without-html​?
mathias··on No HTML needed
This is http://mathiasbynens.be/notes/css-hidden-elements all over again :)

Here’s an even more extreme version with no HTML at all: http://mathiasbynens.be/notes/css-without-html (read it + try the demo in Firefox)

mathias··on True-color GIF with 32697 colors
It’s not “true color”, but it _is_ true-color, as the title says. There’s a difference: http://en.wikipedia.org/wiki/True-color#True_color
mathias··on Dear Apple, let's talk about photos
> Dropbox (if they stopped syncing everything everywhere)

Dropbox has offered selective sync for a while now.

mathias··on LinkedIn is cheating the users
[citation needed]
mathias··on The DOM isn't slow
The reason people say “the DOM is slow” is because it’s slower than anything else in JavaScript, not because of an absolute measurement.

If you’re calling JavaScript features slow or fast based on absolute measurements, you’re doing it wrong. Read up on JavaScript benchmarking. Create and run some jsPerf tests on various devices and browsers, and compare the results. You’ll quickly find that absolute numbers are meaningless in this case.

mathias··on The DOM isn't slow
I call linkbait/trollbait.

> People often throw around the statement “The DOM is slow”. This is a completely false statement. Utterly stupid. Look: http://jsfiddle.net/YNxEK/. Ten THOUSAND divs in about 200 milliseconds.

How is that even an argument? Just because you can insert a fragment containing 10k <div>s in 200 milliseconds doesn’t mean that the DOM is not slow compared to other operations in JavaScript.

DOM operations are still the slowest operations you can perform using JavaScript in a web browser.

mathias··on Consumer key/secret for official Twitter clients
If you ship a binary to a person’s computer and that binary has a secret embedded in it, that secret will eventually be discovered.

This has been discussed here before: http://news.ycombinator.com/item?id=4411696

mathias··on The HTML A element is broken
You may want to read up on HTML Design Principles: <http://www.w3.org/TR/html-design-principles/>.
mathias··on The three levels of HTML5 usage
I’ve always used the term “solidus” whenever I refer to the slash in `/>` in self-closing elements in XML/XHTML.

In any other situation I’d call it a slash.

mathias··on Markdown: The Spec - it's coming and it's full of personalities
> On Macdrifter Gabe Weatherhead said: > > > Nowhere does he mention MMD and it seems very unlikely that he does not know about it. [http://stackoverflow.com/questions/tagged/multimarkdown]

Wow. Just because there’s a Stack Overflow tag for it doesn’t mean that Jeff knows about it. It’s a community-driven site.

mathias··on AntiSec leaks 1,000,001 Apple UDIDs, Device Names/Types
Actually, it’s more like 166:

    $ grep -c -i "titanic\'" iphonelist.txt 
    166
It’s only 190 if you include names like “Titanic’s iPad”, but those aren’t funny.
mathias··on CSS colour names that sound like porn actor names
Porn actor names that sound like CSS color names: Sasha Grey.
mathias··on Write any javascript code with just these characters: ()[]{}+
Now that you mention it — V8 has an interesting bug with excessive Number#toString() decimal digits (http://code.google.com/p/v8/issues/detail?id=1627).

For example:

    (1.1536999999997645e-10).toString(33).match(/[a-z]+/g)[81]; // 'oops'
More here: https://gist.github.com/1153826
mathias··on ~/.osx updated — sensible hacker defaults for OS X Mountain Lion
As the author of ~/.osx, I agree. Never blindly copy anyone else’s settings. Heck, never blindly copy _anything_.
mathias··on ~/.osx updated — sensible hacker defaults for OS X Mountain Lion
Sadly, most of those are outdated. :(
← PreviousPage 3 of 7Next →