Original HN discussion: https://news.ycombinator.com/item?id=6156238
583 karma · joined September 14, 2012
Original HN discussion: https://news.ycombinator.com/item?id=6156238
$ wsend README.md | pbcopy
I mention it because I've found that many Mac users, including some fairly Terminal-savvy folks, are unaware of the pbcopy and pbpaste tools for manipulating the clipboard.
For instance, pretty much all New Zealand wine producers/exporters have been using screw-caps, even on expensive fine wines, since 2001.
For example, the parseInt function mentioned in the article actually does magic base determination. Your string will be parsed into a base-10 number, unless it begins with '0x' in which case base-16 is used, or if it begins with a leading '0' then it is treated as base-8.
This last case has stung me on several occasions when parsing user input into numbers: User puts a leading-zero, and you magically end up with octal conversions. (I believe this whole octal thing has been deprecated in recent JS implementations).
In any case it's sensible to specify the 'radix' whenever using the parseInt function, as in parseInt(numberString, 10);