Labnotes

Published

Weekend Reading — Too soon?

@LASTEXITshirts Too soon?

This week we build a lightsaber app and revisit the PC XT; Node.js reactions do tumblr dot com; we practice naming things; and learn to not prematurely optimize; let AIs talk amongst themselves; we turn the gears on Ferrero Rocher.


Tools of the Trade

iTerm2 Version 3 Just entered beta with many new and exciting feature:: shell integration, session restoration (tmux without tmux!), password manager, even inline images:

Sci-Fi swords and Progressive Web Apps Using the Motion Events, Web Audio and Service Worker APIs to build a lightsaber app that works in any browser.

All Origins Open source alternative to AnyOrigin.com with support for gzipped content. You can use it to fetch data from any website, bypassing same-origin policy, e.g.:

$.getJSON('http://allorigins.pw/get?url=' + encodeURIComponent('http://google.com') + '&callback=?', function(data){
    alert(data.contents);
});

Issue and Pull Request templates Github now allows you to set a template for new issues and pull requests, to help contributors add the right details at the start of the thread.

sindresorhus/refined-github Chrome extension that simplifies the GitHub interface and adds useful features.

straker/html-tagged-template Proposal to improve the DOM creation API using template literals. I'd love to see this added to the DOM:

html`<input type="number" min="${min}" max="${max}" name="number" class="number-input" ${ (disabled ? 'disabled' : '') }/>`;

html`<div class="row">
  <div class="col">
    <div>${text}</div>
  </div>
</div>;

Cache API The Cache API (part of Service Workers), what it is and how to use it.

Introducing Vector Networks Interesting way to deal with vector graphics.

The IPv6 Numeric IP Format is a Serious Usability Problem "Visually parsing an IP address should not feel like visually comprehending C++ templates."

@noahsussman "Hi, this goes in ~/.gitconfig. You're welcome."

[alias]
  whatever = commit -a --fixup HEAD
  whatevs = commit -a --fixup HEAD
  fuck = commit -a --fixup HEAD
  wat = commit -a --fixup HEAD

IBM PC XT running Windows 1.01 This is pretty cool. It's a JavaScript simulation of a PC XT running Windows 1.01. Try and use Notepad, it's as fast as any modern text editor.

@JennyBryan Sometimes I miss XML. Not.

This is your spreadsheet.

This is your spreadsheet on XML


Lingua Scripta

An update on strong mode An update on the strong mode experiment in V8, what worked and what didn't, and why it's going away.

JdeH/Transcrypt Python to JavaScript transpiler.

warning: possible EventEmitter memory leak detected. 11 listeners added. Of course there's a Node.js reactions dot tumblr dot com.


Lines of Code

Naming Things This is something that happens to me a lot. In the process of trying to figure out better variable/function names, I slowly discover the story behind the code, and then rewrite the code to tell that story. What I end up with is more coherent, easier to read, and often even performs better.

In this example, a big pile of "what does this even do?" turns into an obvious fetchRegisteredUsers().then(updateRegisteredUsersTable) -- you don't need to know JavaScript to figure out what it does.

Why Quantity Should be Your Priority And this applies to code, design, documentation, pretty much everything. Or as my wife says, "I'm not made of magic, I'm made of practice".

Let me elaborate: quantity should be a higher priority than quality, because it leads to higher quality. The shorter path to maximized quality is in maximized quantity, and executing on the feedback after each finished product. (Some may say that this is a less refined form of deliberate practise.)

I no longer understand my PhD dissertation Math, with its single letter variables, terse syntax, and "let's just drop all these steps for brevity" ... not so different from programming after all:

“The result now follows easily…” may have made sense back when, but now the author-turned-confused reader can profess that it most certainly does not follow easily, at least in his own mind.

Codeology Turns your Github projects into 3D ASCII art. This is what Zombie.js looks like.


Architectural

Write code that is easy to delete, not easy to extend. This. So much this:

To avoid paying for a lot of code, we build reusable software. The problem with code re-use is that it gets in the way of changing your mind later on.
...

To write code that’s easy to delete: repeat yourself to avoid creating dependencies, but don’t repeat yourself to manage them. Layer your code too: build simple-to-use APIs out of simpler-to-implement but clumsy-to-use parts. Split your code: isolate the hard-to-write and the likely-to-change parts from the rest of the code, and each other. ... Don’t try to do all of these things at the same time, and maybe don’t write so much code in the first place.

Should I Optimize? Calculates whether code is worth optimizing, based on your hourly salary and EC2 instance pricing. Tape this to the office wall: "Are you going to save more than 412 hours of instance time?"


Peopleware

Why Do Employers Rarely Offer Explanations to Rejected Candidates? Cue #notallcandidates:

Just know that a big part of the reason why you can't get insight into your interview performance is likely due to the loud, unprofessional, and often vocal minority who have pretty much ruined it for everyone else.


Techtopia

A Conversation Between Two AIs When two AIs try to schedule a meeting for their humans:

As you can see, the AIs communicate with one another in natural language as a lingua franca. It seems — what’s the AI analog of dehumanizing? — for them to have to put up with such a primitive form of communication. But I suppose it what’s they’re stuck with until the singularity.

@assaf "Damn kids today, never off their phone"


None of the Above

@RyanJohnNelson This, I definitely have to try at home:

That Ferrero Rocher can rotate like gears is probably the most important thing I've learned today.

@BrennenTaylor

thank god I don't have to hunt for my food i don't even know where tacos live

The Shortest Mystery You’ve Ever Watched A creative whodunit that fits into a 6 seconds Vine. See if you can spot the murderer:

Rent A Minority When you can't tell the difference between satire and real life ...

A Tiny Game of Pong The Apple Watch app you've been waiting for since 1972 has finally arrived: Pong!

Kommute Offline reader for any website, so you can keep reading Hacker News while on BART.

@ErinJoanSnyder "WITNESS ME IMMORTAN TUBBS!"

🔥 Looking for more? Subscribe to Weekend Reading.

Or grab the RSS feed