HNHacker News
TopNewBestAskShowJobs

mathias

3,588 karma · joined December 26, 2009

Web standards enthusiast. https://mathiasbynens.be/
submissionscomments
mathias··on ~/.osx updated — sensible hacker defaults for OS X Mountain Lion
As the author of this dotfiles repository, I completely agree. These are my settings, and I’m sure not everyone will like this configuration. The idea is that automating all these OS X preferences (hidden or not) can save you a lot of time if you need to set up new accounts for yourself on a regular basis.

TL;DR This repository is meant to be forked, not used as-is.

mathias··on A file that's both an acceptable HTML page and a JPEG (view source on it)
Or I’m on a phone.
mathias··on A file that's both an acceptable HTML page and a JPEG (view source on it)
I don’t have GraphicsMagick installed on this machine, else I would try this:

    $ gm convert http://lcamtuf.coredump.cx/squirrel/ -comment '' x.jpg
…and…

    $ gm identify -format '%c' http://lcamtuf.coredump.cx/squirrel/
mathias··on `font-family: Comic Sans MS` (without quotes) is valid, working CSS
Why not? :)
mathias··on OSX For Hackers
Me too, given that the original (http://mths.be/osx) made the front page 200 days ago: https://news.ycombinator.com/item?id=2974911
mathias··on OSX For Hackers
@tubbo That’s still possible when the green icons are hidden: no icon means it’s synced successfully.
mathias··on OSX For Hackers
Here’s my reasoning: I assume all files in my Dropbox get synced correctly; if something goes wrong, I’ll be able to tell by the red warning icon anyway. Why would I want the green checkmark icons? They only add visual noise.
mathias··on OSX For Hackers
Sadly, Secrets is a bit outdated. Lots of useful hidden tweaks aren’t listed there.
mathias··on OSX For Hackers
Yeah… But still it’s a bit confusing. It’s almost an exact copy, and no real functionality has been added (except for the four commands jamessb mentioned). I feel like I’m missing something — this is something you would expect to see in a fork, rather than a separate gist.

Oh well, glad to see my dotfiles are of use!

mathias··on How to create and use custom keyboard layouts on OS X
I documented everything I know about custom keyboard layouts on OS X, which have been supported since Jaguar (10.2): how to create them, how to install them on a per-user basis or system-wide, how to make a custom layout the system default (even for the login screen!), and how to assign a custom icon to your self-made keyboard layout.
mathias··on Where’s _why?
And where the fuck is Mark Pilgrim?
mathias··on Which JavaScript property names can be unquoted? When can dot notation be used?
You may have been thinking of ES3, which disallowed the use of unquoted reserved words as property names. So yeah, quoting is still a good idea, especially if backwards compatibility is a concern.
mathias··on Cljbin: A Clojure pastebin with code evaluation
I don’t even use Clojure, but DAYUM this app looks sexy.
mathias··on Which JavaScript property names can be unquoted? When can dot notation be used?
The ECMAScript spec states that engines are free to choose which Unicode version they support, and that Unicode 3.0 is considered to be the lowest common denominator.

Old IEs use an outdated Unicode version (I’d guess Unicode 3.0) to determine whether a given string is a valid identifier name. When using the Unicode 6.1.0 database, much more identifier names are allowed. (More on that here: http://mathiasbynens.be/notes/javascript-identifiers & http://mothereff.in/js-variables.)

Could that be what you’re referring to? Can you give a concrete example of a property name that should be allowed, but fails to work in old IE?

mathias··on Which JavaScript property names can be unquoted? When can dot notation be used?
http://mothereff.in/js-properties#%F0%9D%98%A2%F0%9D%98%AF%F... :(
mathias··on Valid JavaScript variable names
I’ve created a custom OS X keyboard layout that allows me to just press `⌥` + `O` to get `ಠ_ಠ`. Here it is: https://github.com/mathiasbynens/custom.keylayout/tree/maste...
mathias··on Using CSS without HTML
In Opera, it is possible in a way:

    Link: <javascript:alert(1)>; rel="next"
This won’t do anything until you hit the “next” button in the Opera UI (or hit the Space bar, which is a keyboard shortcut for said button).

Example: http://xss-shafigullin-pro.appspot.com/reflector

mathias··on Using CSS without HTML
FWIW, the `Link` HTTP header is defined in RFC 5988: http://tools.ietf.org/html/rfc5988
mathias··on Using CSS without HTML
This is not possible; scripts cannot be added through `<link>`, so there’s no way to add them through the `Link` HTTP header.
mathias··on Using CSS without HTML
Which technique? `::before` / `::after`? That’s not really what this article is about. (Nice site, though!)
mathias··on Using CSS without HTML
> The featured article uses CSS to generate the entire content, which I doubt is of any use besides showing off.

That’s absolutely correct. (To be fair, this is mentioned in the article under “Disclaimer”.)

mathias··on Using CSS without HTML
You can in fact apply CSS to non-HTML documents through the `Link` header. Here’s an example: http://eligrey.com/blog/post/title-image-files-in-opera

Similarly, full `Link` header support would also make it possible to have feed-autodiscovery on non-HTML pages (like images, audio, video, plain text files, etc).

mathias··on The minimal code required in a HTML5 page
Note that `<title>` is optional in a few edge cases. This post has a more in-depth explanation: http://mathiasbynens.be/notes/minimal-html
mathias··on The minimal code required in a HTML5 page
Exactly. Combined with the `Link` HTTP header, it’s even possible to apply CSS to a completely empty HTML document! http://mathiasbynens.be/notes/css-without-html
mathias··on The minimal code required in a HTML5 page
Also see http://mathiasbynens.be/notes/minimal-html for a list of the smallest possible (X)HTML files per version.
mathias··on The minimal code required in a HTML5 page
Note that `<title>` is only optional in a few edge cases. This post has a more in-depth explanation: http://mathiasbynens.be/notes/minimal-html
mathias··on JavaScript’s internal character encoding: UCS-2 or UTF-16?
It’s worth pointing out that `'\ud800'` is not valid UCS-2 either, since UCS-2 technically doesn’t allow surrogate characters.

JavaScript strings are like UCS-2, except that they allow surrogate characters.

mathias··on JavaScript’s internal character encoding: UCS-2 or UTF-16?
Exactly. This makes it more like UCS-2 than like UTF-16.
mathias··on JavaScript’s internal character encoding: UCS-2 or UTF-16?
This.

JavaScript’s internal encoding is closer to UCS-2 than it is to UTF-16, but it doesn’t guarantee that a string is valid UCS-2 (or valid UTF-16).

mathias··on JavaScript’s internal character encoding: UCS-2 or UTF-16?
> It's kind of like saying that 7-bit ASCII and UTF-8 are character encodings for Unicode.

They can only encode a subset of Unicode, sure, but they’re still character encodings for Unicode, right?

← PreviousPage 4 of 7Next →