melreams.com

Nerrrrd

Ember tip of the day

If you use Ember.js and you need to update one element of an array inside you rmodel, you need to use the .replace() method. Getting and updating your array will not work, neither will trying to use this.set(‘model.array[index]’). Ember won’t register your changes unless you call the .replace() method, so do that :)

And yes, I’m writing this blog post to remind myself, I spent a good hour or two earlier this week trying to figure out why Ember wouldn’t re-render anything when I tried to update part of my model.

Awesome Chrome extension of the day

I recently started using StayFocusd and it rocks! StayFocusd is a productivity tool that stops you from visiting websites where you waste time. Whatever your timesinks are (for me feedly and reddit are some of the worst), you just add them to StayFocusd’s blocklist and after 10 minutes (or whatever time you set), it blocks them. By default it also blocks links that you clicked while on a site in your block list. For example, if you follow a link from reddit, that still counts toward your 10 minutes of browsing for that day.

I’m not sure how I feel about having to outsource my self-control to a Chrome extension, but on the upside I get a lot more done when I don’t have to make the decision between doing work and checking feedly again for shiny new blog posts. Try it, you’ll probably hate it but you’ll probably get more done :)

Underrated dev tool of the day

You might not expect it, but thesaurus.com is actually a really useful dev tool. Like they say, naming things is one of two hard problems in computer science. When I have an object that’s difficult to think of a good name for, I just plug whatever vague description I have into thesaurus.com and poke through synonyms until I find something I don’t hate. Try it, it really does make it easier to pick a name :)

Scheme tip of the day

Get Racket. Technically the racket IDE is for the Racket language, but it works just fine with scheme if you put “#lang scheme” (minus the quotes) at the top of your .scm file. The thing I really love about Racket is the debugger. You can actually step through your scheme code instead of just littering it with (display <blah>)! So much easier!

Fiddler rocks

Fiddler rocks. Fiddler is a free web debugging proxy for any browser, system or platform. I’ve only ever used it on Windows so I can’t speak to how it performs on any other OS, but on Windows it’s pretty great.

To go into a little more detail, Fiddler captures every request your browser makes and lets you save, retrieve, and analyze them. Mostly I use it for simple things like seeing the full error message and headers returned by a failed api call when all my javascript is telling me is that “something went wrong.” Thanks js, you’re a big help.

A lot of why I like Fiddler so much is just personal preference. The network tab in Chrome dev tools does a lot of the things I use Fiddler for, but I like Fiddler’s interface better. Fiddler does have some differences, though. If you want to save a few rounds of requests across page refreshes so you can compare them to each other, Fiddler lets you do that. It also has a more powerful filtering system than Chrome dev tools, so you only have to see the requests you care about.

Another awesome thing you can do with Fiddler is set up a mobile device to use it as a proxy. Logging from a mobile app is all well and good, but sometimes it takes much longer to add logging, rebuild, and redeploy than it does to just update your mobile network settings to use Fiddler as a proxy.

While I mostly use Fiddler for very simple request/response viewing, you can do some pretty cool stuff with it like performance testing, session manipulation, and security testing. There are also lots of add-ons you can try if Fiddler doesn’t already do what you want, plus you can customize it on your own.

As much as I love Fiddler, there is one caveat I need to mention. Firefox is totally incapable of coping with Fiddler unless you change some settings. I strongly recommend that you do that immediately if you install Fiddler because you will forget that you have Fiddler running, try to test something in Firefox, and freak out because everything is suddenly broken (not that I’ve ever done that. Repeatedly). It’s not, Firefox should just be ashamed of itself. Even IE can handle a freaking proxy. You used to be cool, FF. Now you’re like a broken down racecar that’s getting lapped by a go-kart. With square wheels. That’s been set on fire.

Why should you care about Fiddler? It might be better than what you’re doing right now. Having better tools to do the tedious stuff for you means more time for actual development, even if you have to invest a few minutes up front to figure out if Fiddler is actually better than what you’re using right now. It won’t magically make you a better developer, but it will give you more time for development, which can be pretty close to the same thing :)

Android tip of the day

There’s this really awesome utility for Android called Tasker that lets you automate all kinds of stuff on your phone. I love how much stuff I can do with it, but the interface doesn’t just fail to be user friendly, it’s actively user hostile. Every damn time I set up a phone I forget how to configure Tasker to automatically unlock my phone when I’m at home. This little how-to guide explains it all really clearly and (at least for now) matches Tasker’s interface.