Category Archives: News

React: The Documentary

The documentary on the origins of React is finally out! This technology fundamentally changed the way the world did front-end development and how we create web application. I’m super proud and honored to be representing the innovative folks at Netflix who were brave enough to adopt this transformative new technology and outrun the competition.

Lightpack Backlight Array for TV

For a weekend project I built a backlight array for my TV which gives off ambient lighting according to what colors are being shown across the edges of the screen. Powered by a microduino and Abalight software for Mac.

According to the experts, backlights offset the brightness of the screen by lighting up the entire wall, while also giving the impression that the movie is bigger than just the screen. ¬†I just say “woot.”

A Check-in On Priorities

The Dalai Lama, when asked what surprised him most about humanity, answered:

“Man…. Because he sacrifices his health in order to make money.

Then he sacrifices money to recuperate his health.

And then he is so anxious about the future that he does not enjoy the present.

The result being that he does not live in the present or the future; ¬†he lives as if he is never going to die, and then dies having never really lived.”

Apple Quietly Updates Website in Response to Watch Scratch Issues

I had been wearing a demo Apple Watch Sport for a few days, when I noticed a few scratches on the screen. Damn, I thought. It had only been a few days and I hadn’t bumped or scraped it on anything significant. In addition, I had been cleaning it with a microfiber cloth, so I was sure it hadn’t been from that. But it was still odd considering how long I’ve had an iPhone 6 with no cover and 0 scratches. So I did a little digging.

Sure enough there are a few threads on Apple’s own website detailing how common, everyday usage is resulting in scratches. Disappointing, but maybe people are simply being careless. However, for some non-transparent reason Apple has also quietly updated their product text removing all mention of being scratch resistant.¬†

Rolling back 2 weeks on Apple’s own product page for the watch, we see the following text. Notice the phrase, “especially resistant to scratches and impact.

Screen Shot 2015-09-27 at 6.41.28 AM

But if you look at the current version of the product page, you’ll see this text.

Screen Shot 2015-09-27 at 6.39.12 AM

Apple removed front page, product messaging referencing its watch being scratch proof.

Chasing 60fps, Using ReactJS to Rebuild Netflix.com

Here’s my recent talk entitled “Chasing 60fps, Using ReactJs to Rebuild Netflix.com.” ¬†We discuss both the advantages and challenges of building with ReactJS for the new Netflix UI.

Links from the talk
react-render-visualizer
TimeoutTransitionGroup Mod
ESLint Plugins http://tiny.cc/nflx-eslint1  http://tiny.cc/nflx-eslint2

Caching Proxy Requests and Stripping Params with Nginx

nginx

I recently need to set up caching for a very slow API service I was working with. ¬†However the app I was working with¬†forced a query param of “timestamp” on all requests. ¬†This effectively killed the cache because all api requests were flowing through a single endpoint, and only the query params differentiated the requests. ¬†So here’s how to set up caching and strip out query params with nginx.

http {
    # Create a storage location for 
    # caching and call this location "my-app"
    proxy_cache_path /data/nginx/cache levels=1:2 
         keys_zone=global:10m 
         max_size=100m inactive=60m;
    
    server {
    
        location /api/  {
            # Strip out query param "timestamp"
            if ($args ~ (.*)&timestamp=[^&]*(.*)) {
                set $args $1$2;
            }

            # Use the "my-app" cache defined above
            proxy_cache my-app;

            # Only cache 200 responses and cache for 20mins
            proxy_cache_valid 200 20m;

            # Create a unique cache key
            proxy_cache_key 
                "$scheme$request_method$host$uri$is_args$args";
            
            # Proxy the request
            proxy_pass http://myapi.com;
        }
}