HNHacker News
TopNewBestAskShowJobs

chncdcksn

29 karma · joined April 13, 2015

submissionscomments
chncdcksn··on On the Sad State of Macintosh Hardware
Purchased one about a year ago. Screen, sound card, and keyboard needed to be replaced on arrival. Replaced the screen and sound card under warranty and sold it disclosing that the keyboard’s spacebar sometimes inserted two spaces on one press. Have Dell’s QA issues on this laptop gotten any better?
chncdcksn··on Redesigning Redux
(To preface, I use React/Redux in all of my web applications. I think Redux is great for managing state.)

One thing I’ve never quite understood about Redux is why we are dispatching pure data instead of a function of state. This would remove the need for reducers, since your action _is_ your reducer. Something like this...

https://gist.github.com/anonymous/a5d741c5dec81be61e0aa70820...

Would this come with any drawbacks? I could see a large application having performance issues because of a large number of function allocations, but for small applications I don’t see a downside, just a simpler API.

chncdcksn··on Show HN: EC2 price API
Doesn't seem to be working for me in Chrome on Android. I submit the form, the page goes blank, and nothing else happens. Also, a suggestion, the fields rendering in a random order will be very confusing to someone if they are going to be using this multiple times in a row to compare pricing of different EC2 specs. I was very confused when region was at the very bottom the first time I tried to submit the form, then at the very top the second time.
chncdcksn··on Gravity: a new programming language and VM written in C
May be off topic, but did Apple remove their restriction on using a VM in an app put on the App Store? Or was that restriction only for JITs and not interpreters?
chncdcksn··on Cross-Site Request Forgery is dead
TIL. Thanks!
chncdcksn··on Cross-Site Request Forgery is dead
I may be wrong, but I don't think JavaScripts from a CDN can access the same localStorage as some JavaScript from another origin. (Source: "Cross-origin data storage access" https://developer.mozilla.org/en-US/docs/Web/Security/Same-o...)
chncdcksn··on Cross-Site Request Forgery is dead
The big issue using localStorage for authentication token storage is that values are accessible by any JS from the same origin as the JS that sets the value. Example: I bundle my JS and it's dependencies into a single file (bundle.js) using webpack. One of the dependencies in the bundle has malicious JS that sends values in localStorage to a remote server, or uses the authentication token to make requests impersonating the user.
chncdcksn··on GitLab 8.15 Released
That's really strange; I received an email today, with the previous emails being on the 8th and on Nov. 22. What is the contents of the emails, and what address are they from? Are they duplicate emails? Sounds like someone impersonating GitLab.
chncdcksn··on 'Clean your desk': My Amazon interview experience
I'm curious, what was the trick question given to you by Microsoft Boulder?
chncdcksn··on Next.js – A small framework for server-rendered universal JavaScript apps
You may be interested in Opa (http://opalang.org). I'm unsure how well it abstracts away client/server detection, but from what I understand about it, you have one codebase for both your client and server. I've never used it however, so I can't vouch for it entirely, but it certainly looks interesting.
chncdcksn··on Ways to Avoid Complexity in Modern C++ [pdf]
Does Rust fit into those specifications? I understand library support is probably not quite there yet, but I was under the impression it could fill the role of C/C++.
chncdcksn··on Picoc: A very small C interpreter for scripting
As a student interested in language design and VM programming, this is wonderful. Clean, easy to read code, as well as what seems to be a really well-thought out language. Thanks for this!
chncdcksn··on Jankyscroll – a JavaScript library that doesn't need to exist
Switch to the master branch. :) it confused me too.
chncdcksn··on AWS S3 Outage
GitHub is having release download issues, possibly due to this. https://status.github.com/
chncdcksn··on Show HN: A Hand-Drawn QR Code Alternative
A problem I see with this is recognition. A QR code can be printed onto a piece of paper with no further information attached, and even some less-techy people will know what to do with it, because it's clearly a QR code. These drawings are pretty ambiguous, and unless it catches on with the less-techy crowd you'd have to add an attached note "Go download the Meshtag app to read this!", which would probably not happen too often.

They are however, much prettier than regular QR codes. :)

chncdcksn··on ES6: The features I'm most excited about
.then() does create a new promise. Return Promise.reject() in the fulfillment function to reject the new promise.

  somethingThatReturnsPromiseWithoutError()
    .then((res) => {
      return Promise.reject("some error");
    })
    .catch((err) => {
      console.log(err); // => some error
    });
Promise.resolve() and Promise.reject() return a promise resolved or rejected to the value passed in the first argument. Returning a promise in the fulfillment function passed to .then() chains the promises together.

  somethingThatReturnsPromise()
    .then((foo) => {
      return foo.bar;
      // Or if you like it more verbose
      return Promise.resolve(foo.bar);
      // Or pass bar to a function modifying bar that returns a promise
      return modifyBarReturnPromise(foo.bar);
    })
    .then((newBar) => {
      console.log(newBar);
    });
In your case, if you need step1Val in next promise chain, I personally do this, however people more familiar with promises may know of a better way to do it (maybe with something like Promise.all() or Promise.props() in the BlueBird library).

  somethingThatReturnsPromise()
    .then((first) => {
       doSomethingWithFirstAndReturnPromise(first)
         .then((second) => {
           console.log(first + second);
         });
    });
chncdcksn··on Confetti – Tumblr for events
I'm having the same issue actually. Firefox 37 on Windows 8.1.