melreams.com

Nerrrrd

Linux tip of the day

If you want to see when you ran a particular command on a linux, you just need to run

HISTTIMEFORMAT="%d/%m/%y %T "

at the command prompt, then the next time you run

history

you'll have handy timestamps! Thanks as usual to stackoverflow for that answer.

So that's cool and all, but why should you care? Because being systematic is extremely important when you're trying to solve a problem. If you don't know exactly when you changed something, you'll have a rough time figuring out which results were caused by which change. If you don't know which change caused which results, you're effectively stumbling around in a dark room at random, hoping you run into a light switch. Not only is that frustrating, but it's a huge waste of time. Systematically changing one thing, checking on the results, then changing one more thing and checking the results again can seem slow, but in the long run it's much faster than stumbling around and hoping.

Using myself as an example, knowing exactly when I ran a particular command let me compare what I had done with what was showing up in the logs and showed me that it was most likely a combination of two commands I had run rather than a weird delay after the first command that gave me the results I wanted. If I hadn't been able to figure out exactly when I ran each command I would still have no idea which one of them helped.

Tip of the day

Haven’t finished your Christmas shopping yet? Haven’t started? A really convenient last minute gift is giving to charity in your gift-getter’s name. CharityWatch has a great list of trustworthy charities and GiveWell will give your donations directly to the charities that they’ve found to be the most effective.

Or you could just go to the liquor store if you’re not worried about looking classy ;)

Talk of the day

I really enjoyed this recording of the Pycon 2015 keynote and I think you will too. My favourite part was the bit about we are all statistically unlikely to be terrible – it’s called a normal distribution for a reason, most of us are, drumroll please…. normal! Sure, you’re not super likely to be extraordinary (if everyone was then it really wouldn’t be extraordinary), but you’re not super likely to be terrible either. I personally find that comforting to remind myself of when I’m struggling with something and feel totally useless.

Dev tool of the day

Hey java devs, somebody built a REPL! It even runs in the browser, nothing to install or configure (or curse at). I love this thing for when I can’t remember which function accepts a null parameter and which one freaks out and throws a null pointer exception, it’s so helpful.

There is a REPL in Java 9, but we haven’t even switched to 8 yet at work (always let someone else try the new stuff first :) ). If you’re not exactly on the cutting edge either, try the online REPL, it’s awesome.

Talk of the day

If you share my obsession with software design (and maybe even if you don’t) you’ll enjoy this talk by Katrina Owen called Overkill. The basic idea of the talk is the use of a simple toy problem as an excuse for focused practice. I really like the idea of going back to basics as a path to mastery, that’s actually why I’ve been on my own back to basics kick on this blog.

If you like that talk, Katrina Owen co-authored an object oriented design book with Sandi Metz (who is also fantastic) called 99 Bottles of OOP. I haven’t read all of it myself yet, but I have watched (well, listened to) a few of Katrina’s and Sandi’s talks and really enjoyed them.

Chrome extension of the day

You know what sucks? Desperately trying to figure out how you broke your html layout, only to discover hours later that you had an invisible element or padding or a margin that was quietly ruining everything. Pesticide to the rescue! Pesticide is a very simple Chrome extension that does just one thing – it outlines all of your elements. That’s it.

I have a thing for simple tools that do one thing and do it well, and Pesticide is just that. No screwing around with settings, no trying to remember how to activate it, you just click the little bug icon beside your omnibox to turn it on and click it again to turn it off. Simple is just what you need when you’re fighting with your layout. Try it, you just might like it!

Relaxation app of the day

Remember that delightfully sweary “F*ck that, an honest meditation” video? It’s an Android and iOS app now! As silly as it sounds, it really does help me relax. I find that relentlessly cheerful “everything is great!” guided meditations just annoy me when everything is not great, even if “not great” is sometimes as minor as having fought with a badly documented API all day. The F*ck that video and app really work for me because they don’t lie about everything being great, they tell you that you can be okay even when things suck. Plus, who doesn’t love a guided meditation that refers to your life as a three-ring shitshow?

The app itself is very basic, you choose a meditation length from two to fifteen minutes and that’s it. It’s also only $2, so why not give it a shot?

Redis tip of the day

Redis has a few commands that are dangerously similar. Two of them are rpush and rpushx. rpush appends items to the list at the given key, and creates a new list if the key doesn’t already exist. rpushx, on the other hand, appends items to the list at the given key if and only if the key already exists. If that key doesn’t exist, nothing happens.

If you use redis for anything, make sure the command you’re using is really the command you thought you were using. Learn from my mistakes, it could save you hours of swearing at your unit tests :)