Hello Japan

We changed a few things at Netflix.com to prepare for our new Japanese friends:

  • Image-Based Subtitles to support vertical text, furigana (rubies), bouten (emphasis). This also sets us up for subtitles in other languages that don’t use a Latin script
  • On-Screen Keyboard for Darwin (user selects kana, yielding kanji suggestions)
  • Search tokenizes input (no spaces in Japanese), normalize to two possible search scripts
  • Typographic differences (bold and italic not used)
  • Multi-Language box art
  • Metadata length
  • First / last name order in sign up
  • Studio Copyright attribution

Points written by Joubert Nel


Weberize ALL the components

Some folks in Netflix’s Digital Supply Chain have agreed that Web Components are a good interop container. I also (perhaps controversially) believe people should also use WCs whenever effective as it’s simply native to the web. Telling someone to not use WCs is like telling someone not to use document.querySelector or Array::forEach. The war against React zealots is treacherous and ongoing.


Asynchronous communication

I was at a company called Amco a few years ago. It was my first Senior position outside of running my own company. The VP of Engineering there (Jason King) taught us something he called “asynchronous communication”. It’s the concept that sharing information globally and digitally is more efficient than individually & physically. By sharing with more people, and in a way that they can respond as convenient to them, you optimize the quality and quantity of feedback you can receive. When everyone does this, it make everyone better. It definitely made me better and I think Netflix will get better if we all start practicing asynchronous communication. Ways we can do this are:

  • Remote pair programming tools that support multiple people
  • Google Docs
  • Frequent pull requests

Viewing images right inside iTerm 2.9

Call me crazy, but viewing images from a CLI app can be pretty cool.
Yes, we have the ancient art of ASCII (and that will not go away)
but why not use a real image in some cases?

Now the nice folks behind iTerm 2 have made that possible in versions
of iTerm post-2.9. I do not claim this has not been done before, but
I am unaware of this capability in Terminal. Anyway, on to the goods:

Steps for ZSH Users

[ iTerm & ZSH, great together ]

  • mkdir ~/Projects/iterm/imgcat && cd !$
  • wget https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat
  • wget http://p1cdn01.thewrap.com/images/2014/05/Halt-and-Catch-Fire-8.jpg -O hacf.jpg
  • Change $PATH to include ~/Projects/iterm/imgcat
  • Reload your shell
  • imgcat hacf.jpg

Halt and Catch Fire


set-upstream-to

Hello friends! Are you tired of this message:

There is no tracking information for the current branch.

I am too! So I searched the OhMyZSH repo for set-upstream-to and re-discovered this command: ggsup. Calling ggsup with the name of the branch you want to track will get you to the place you want to be. W00t!

To recap. Call

1
2
3
ggsup master
```
...to track `master`. Call

ggsup dev
```
…to track dev. Get trrrrrracking team!


Definition: The Zone (Programming)

(The) Zone

noun

The state in which all resistance to progress is non-present. Easy flow of information from subconscious to conscious mind, characterized by clarity of purpose, speed of achievement and the full architecture of your project being held intact at the front of your mind. “Peak zone” is typically sustainable for 2-4 hours but takes 15-30 minutes to “boot up” into and is easily knocked down like a deck of cards if the “zonee” is disturbed by someone outside the zone.


Dev Letters: TMZ for Developers

Some of the most useful and lasting content has come from letters between colleagues. In this tradition, I
will post some developer insight that’s shared between myself and other developers.

Tim

You’ve sent out some good stuff lately [on our JavaScript DL]. What’s your source? Is there a site I can check daily—a TMZ for developers?

James

  1. I’ve decided to share even when I’m really “in the zone”, whereas previously I shared when I was bored
  2. I make liberal use of IFTTT. I let the computers monitor the web and ping me when something “interesting” happens. E.g. I have Facebook’s Github profile monitored for new repos
  3. I listen to the “5 Minutes of JavaScript” podcast. 3/4 of their content is too junior, but the 1/4 that’s not is worth it

Capitalization of modules in Node.js

Tradition in Node.js dictates you import core modules using this style:

1
2
var fs = require('fs');
fs.readFile(packageJSONPath, readOperationDidFinish);

I’ve adhered to that style for the most part, but it’s always rubbed me the wrong way.
As a core modules that points to a collection of static methods, capitalization is more appropriate.

1
2
var FS = require('fs');
FS.readFile(packageJSONPath, readOperationDidFinish);

Where the correct decision becomes most apparent is when using the path module:

1
2
3
var Path = require('path');
var join = Path.join;
var path = join(process.cwd(), 'package.json');

We used lowercase for local values, and using lowercase for the path module easily results in naming conflicts.


git pug

I am an idiot who subconciously likes pugs, so I often type git pug instead of git push or git pull. Is this truly a problem?
Note if I execute the following:

1
npm install pugme -g

Then place this in my ZSH aliases file:

1
2
3
4
5
6
7
git() {
if [[ $@ == "pug" ]]; then
command pugme
else
command git "$@"
fi
}

Which results in


Harmonious Node.js

Setting up NVM w/ ZSH

Execute the following

1
2
3
4
5
mkdir -p ~ZSH_CUSTOM/plugins
cd ~ZSH_CUSTOM/plugins
git clone git://github.com/rummik/nvm-zsh.git
cd nvm-zsh
git submodule update --init

Then edit the plugins array in your ~/.zshrc to include nvm-zsh so that it
looks somewhat like this: plugins=(nvm-zsh history-substring-search git osx ruby)

Installing a newer version of node

  • Run nvm ls-remote to determine the latest version of Node
  • Install it: nvm install v0.11.15
  • Run node --v8-options | grep harmony to determine which harmony features are supported
  • Start using harmony features by running your code with node --harmony foo.js

Gotchas w/ Arrow Functions in ES6/Harmony

Note that the following does not work:

1
2
3
4
5
6
7
8
9
function ES6Example(){}
ES6Example.prototype.foo = function(bar){
return ((baz) => {
this.bar = baz
})(bar)
}
var es6Example = new ES6Example
es6Example.foo('qux')
console.info(es6Example.bar) //undefined

But this does:

1
2
3
4
5
6
7
8
function ES6Example(){
this.foo = baz => {
this.bar = baz
}
}
var es6Example = new ES6Example
es6Example.foo('qux')
console.info(es6Example.bar) // 'qux'