HNHacker News
TopNewBestAskShowJobs

dan15

90 karma · joined September 8, 2012

[ my public key: https://keybase.io/daniel15; my proof: https://keybase.io/daniel15/sigs/K6tdwXC_1JOwqVVDqul5RkUBKPYFa4MIJlSKPm6nZIE ]
submissionscomments
dan15··on Workplace by Facebook opens to sell enterprise social networking to the masses
This is what I see groups for. Chat for small groups, Facebook groups for larger groups and long-form posts that require more in-depth discussion. This is what we do internally at Facebook and it works pretty well.
dan15··on React Tutorial: Cloning Yelp
Out of curiosity, why did you write the function like this:

   const MyRootComponent = (props) => {
When it's shorter and more obvious what's happening if you write them like this:

  function MyRootComponent(props) {
dan15··on DuckDuckGo ES6 Cheatsheet
I have a TextExpander macro for ¯\_(ツ)_/¯, which has improved my efficiency by several orders of magnitude.
dan15··on Draft.js – Rich Text Editor Framework for React
It's open source, take a look at the source code? :D
dan15··on Move Fast and Fix Things
> Right now, many Windows GUIs (SmartGit/SourceTree) use 'git.exe' to manage the actual Git repositories.

For what it's worth, all of the Git functionality in Visual Studio uses libgit2.

dan15··on Pandora to Buy Rdio Assets for $75M, Rdio Files Ch.11, Will Shutter Service
You can use the media keys with Google Play Music in a browser, at least in Chrome. No third-party app required.
dan15··on Postgres gets support for upsert
You love Postgres because it takes four years to get requested features?
dan15··on Facebook PathPicker
Why not actual Linux packages (DEB and RPM)?
dan15··on React v0.13.0 Beta 1
> IMHO, classic OOP doesn't fit to modern JS.

ES6 classes aren't "classic OOP", they're syntax sugar for regular prototypal inheritance that JavaScript has had forever.

dan15··on Io.js 1.0.0
Yes, but something "JavaScript runtime with npm compatibility" would be friendlier and significantly easier for people to understand.
dan15··on Io.js 1.0.0
We should start referring to PHP as a "Composer compatible platform" and Python as a "PyPI compatible platform"
dan15··on Yahoo Mail moving to React
Hey, I'm the developer of ReactJS.NET. Thanks for trying it out!

> Any client-side routes will need to be mirrored on the server if you want isomorphism. This means you're using two routers.

A while back I worked on a library called [RouteJs](http://dan.cx/projects/routejs) that would expose certain ASP.NET MVC routes to JavaScript. The use case here was to have a way to build URLs client-side rather than hard-coding them (similar to the `Url.Action` helper in Razor) but a similar technique could be used to do client-side routing. That's actually a really good feature request for RouteJs :)

> The next issue is that most of the examples out there are simplistic. They will show a simple page with one component embedded that swaps out a part of the view.

Yeah, that's true. I have one page using server-side rendering in production, and it's a page on my site/blog: http://dan.cx/socialfeed.htm. It's also a simple page but I used it for building the original proof-of-concept for server-side rendering. I haven't actually tried using ReactJS.NET to build a single-page app, but I think that would be an interesting use case.

dan15··on One reason I dread Google doc shares
Font rendering can differ between different OSes but it's usually not too bad.
dan15··on Flux Application Architecture
There's a TodoMVC example that you might find helpful: http://facebook.github.io/react/docs/flux-todo-list.html

It'd probably be worth having a barebones starter kit though.

dan15··on Ubuntu 14.04 LTS: the cloud platform of choice
So what does Ubuntu do that Debian doesn't?
dan15··on HHVM 3.0.0
If you click on any of the methods in the manual, you'll see "NOT SUPPORTED IN HHVM" in a large font. I'm guessing it's an oversight that that text is missing from the topic index as well.
dan15··on HHVM 3.0.0
I work at Facebook as well, but mainly in JavaScript so I haven't done a lot of PHP either :)

You could use a common PHP framework like FuelPHP, Laravel or Kohana. I'm not sure which frameworks are 100% compatible with HHVM, but I think they're all getting quite close to 100% (or may even be at 100% with the 3.0 release). It's fine to mix PHP and Hack in the one project, so you could use a PHP framework and use Hack just for your code.

dan15··on Netflix disables use of the Chrome developer console
That and Facebook's one shows a huge message saying why they do it.
dan15··on Netflix disables use of the Chrome developer console
Yeah I'm not sure about Netflix's motivation, but Facebook's was purely to prevent self-XSS, and you can easily opt out of it.
dan15··on Alleged Mt.Gox code leaked on IRC node by Russian Hacker
Yeah, Hack for HHVM adds a bunch of stuff to PHP to make it better, including:

- Collection classes like Vector (which is like an array in every other programming language ever) and Map (associative array or hashtable)

- Generics

- Lambda functions

- Asynchronous functions

- Type hinting for intrinsic types (int, string, bool)

Not much public documentation yet, but most bits are in the open source HHVM release, and there are a few blog posts on it (eg. http://www.sitepoint.com/hhvm-hack-part-1/)

dan15··on Alleged Mt.Gox code leaked on IRC node by Russian Hacker
Some software will use a specific money or decimal type (some databases support these). Others will store money as an integer in the smallest units needed. ie. if you only need dollars to the nearest cent, store the number as cents ($1.50 is stored as 150)
dan15··on Alleged Mt.Gox code leaked on IRC node by Russian Hacker
This solution is just reimplementing stored procedures in a less efficient way. If you want to keep the SQL separate, stick it in a stored procedure.
dan15··on Alleged Mt.Gox code leaked on IRC node by Russian Hacker
Anything in particular about this code that makes you cry and cringe?
dan15··on React: Another Level of Indirection
ASP.NET Web Forms may have been fine if it was only UI and UI logic rather than an odd mashup of UI + business logic + a crazily complicated page life cycle. The initial versions of ASP.NET MVC used Web Forms purely as a view layer which worked quite well.

At my previous workplace we were converting a classic ASP + ASP.NET Web Forms app to MVC. I really love MVC but I did like the component encapsulation in web forms.

dan15··on React: Another Level of Indirection
Except UpdatePanels are horrid whereas React is quite nice :P
dan15··on HipHop VM: now at 98.5% PHP framework parity, 16% faster
While you're at it, convert intrinsic types to objects too, while retaining backwards compatibility:

    $foo = 'bar';
    echo $foo->length(); // 3
    echo strlen($foo); // 3
This would get rid of a lot of the confusion around string function names.
dan15··on HipHop VM: now at 98.5% PHP framework parity, 16% faster
Recording requests is a good idea.

Another idea once you're reasonably comfortable and have done a smoke test is to direct a small amount of your traffic/users (say 1%) to the HHVM version, while closely monitoring its error log.

dan15··on HipHop VM: now at 98.5% PHP framework parity, 16% faster
What does Laravel do that other frameworks like FuelPHP and Yii don't do? I hear a lot about it but don't hear a lot about why it's so much better than others.
dan15··on Facebook saves everything you type - even if you don't publish it
No they don't, that headline is very misleading and is a huge misinterpretation of the paper. For a small portion of the userbase, Facebook detect IF they self-censor and just transmit that. They only see metadata, and not the actual contents of the message.
dan15··on I want the NBN
I'll just leave Shaun Micallef's segment on Tony Abbott's NBN here: http://www.youtube.com/watch?v=b-6E5yX1E0U
← PreviousPage 3 of 4Next →