What's the diff?

One of the key concepts behind version control systems (like git or mercurial), is the differential or “diff.” By diffing between code at two different states (last commit, and current state), you can see, line by line, what was added & deleted.

Text is well suited to line by line comparison, but what about images? Can you do the same type of before / after comparison? Well, kinda!

Uber’s image-diff node library uses ImageMagick to calculate visual differentials between equally sized images:

image-diff demo

The first two frames of the animation are screenshots from my Twitter timeline taken 30 seconds apart. The 3rd frame is the diff, highlighting what changed in red.

Unlike with text, image-diff can’t tell you, which pixels are new / old, but it does show the aggregate change. There’s also CLI version you can run without writing any code.

Copy. Paste. Python.

Control-c and Control-v were the first keyboard shortcuts I ever learned, (quickly followed by Control-Alt-Delete). I probably copy/paste upwards of 100 a day, but I often feel like I’m secretly hiding things from my computer when I use copy/paste.

Imagine handing your friend a diplomatic pouch full of missile codes, forbidding him from looking inside, and then asking for it back. That’s what the clipboard is like!

Anywhoozles, I found a cool Python package that lets you programmatically access your clipboard. It’s called Pyperclip, was written by Al Sweigart, and works on OSX, Windows, and Linux. It’s only got two methods: .copy() and .paste(), but that’s all you’ll need.

Pyperclip demo gif

$5 3D printed stethoscope

Stethoscopes, basic listening devices, enable doctors to diagnose tons of medical conditions. But, despite their 200 year history and numerous expired patents, even simple models can cost over $100. That’s way too much.

Enter Tarek Loubani’s Glia Free Medical hardware project. Glia designs open source medical hardware that can be built at a fraction of the cost using 3d printing and alternative manufacturing methods. There are several projects in the works including oximeters, a loom for weaving gauze, and surgical tools — but my favorite is the $5 Stethoscope.

photo of 3D printed stethoscope from vosizneias.com

Using DIY silicone molded earplugs, cheap PVC tubing, scrap plastic, and some 3D printed parts (ear tubes, y tube, and head), you can build your own stethoscope that performs as well the industry standard Littmann III. Once again, open source makes the world a better place!

Emoji life

In the 90s I made my dad buy me a book about smileys. He pointed out that I could find every possible combination of sideways smiles via gopher & newsgroups, but I was determined to have it in print.

Today, we’ve swapped sideways smileys for unicode emoji, which are superior in almost every possible way. To say they are immensely popular would be an understatement, we can’t design new emoji fast enough.

They’ve got their own secret meanings. We’ve brought them to life as throw pillows & pool floats. And we’ve built software around them:

Want to extract high quality PNGs from Apple’s official emoji set? Use this Ruby script.

How about programmatically adjusting emoji skin tones? You can do that with JavaScript.

Need help finding the right emoji to complement your text? Use machine learning.

Even if our attention spans are decreasing & language diversity is drying up, I’m sure we’ll all be able to find an emoji to express how we just. can’t. even. 😒

Your password sucks

Passwords are the worst and you’re probably terrible at them. #Sorrynotsorry

No really. Due to a toxic brew of poorly salted passwords, frequent security breaches, credential reuse, and boneheaded length / character rules (looking at you banks), web security sucks.

Combined with brute force and your email address, black hats can iterate over thousands of common passwords to break into your accounts. No bueno 💀

Of course, there’s two factor authentication (you’re using Authy right?) and password managers (LastPass, OnePass, Keypass - I don’t care which, just use one) — but passwords are always the weakest link.

Don’t despair though, there’s some good news in all this: with a database of the 10,000 most commonly used (and thus WORST) passwords, Stupid Passwords lets you test to see if your passwords are objectively awful:


const stupidPasswords = require('stupid-passwords');

const x = stupidPasswords.isStupid('hello');
// true -> bad password
// interestingly, 'god' isn't on the list...

const y = stupidPasswords.isStupid('1am$up3rc00l');
// false -> not a -terrible- password, but could be better

const z = stupidPasswords.rateOfUsage('hello')
// {password: 'hello', frequency: 1644 }
// i mean, come on

Much like forest fires, only you can prevent the crack-ening of your digital identity. Now go test your passwords and turn on two-factor!

2016 Neal Shyam