It happens to all of us, our productivity bottoms out and it feels like there’s no escape. Sometimes it’s a lack of motivation, sometimes it’s pounding your head against a problem without any progress, sometimes it’s too many distractions. Whatever the cause, there’s a few things I’ve found help snap out me out of it.

Notice the Symptoms

If you’ve stumbled across this post you probably already know you’re in a slump. Heck, I’m writing this because I’ve noticed it’s currently happening to me and need to remind myself how to deal with it – again. However, if you can notice it earlier it’s often easier to deal with. Sometimes I’ve gotten into a deeper and deeper rut without doing anything, and it’s monumentally harder to get out at that point. Just like you should have ways of monitoring your work systems to know if there’s a problem you should have ways to monitor your mental state to know if there’s a problem. You’d think we’d all be self aware enough to notice our own mental states, but it’s amazing the way our brains can work so that we have a nearly complete lack of self awareness for long periods of time.

Obviously different people will have different signs that things are going off the rails. For me an easy to measure metric, with respect to work at least, is my commit history frequency. If I notice my commit history has greatly slowed or ceased for a period it’s a bad sign.

Another sign for me is that I start Googling my negative thoughts. I’ll sit down to do some work, and next thing I know I’ve got a search results page open for “why can’t I make myself do work?”. Maybe that’s how you ended up here… Rarely are those search results useful in actually breaking me out of a funk – unless I notice what I’m doing and start acting. I can read search results for hours and not end up actually doing anything, or perhaps more accurately I should say I can click a search result and hours later realize I’ve somehow clicked links until I end up on the list of paradoxes page on Wikipedia again.

So start to notice the signs that you’re in a slump, write them down, repeat them out loud, whatever you need to do to make it possible to notice earlier when they start to happen. Then you can start addressing the problem before it gets worse.

Long Term Fixes

When I find myself in a stuck state for more than a short period of time it’s almost always because I’ve been neglecting the obvious long term solutions: sleep, exercise, diet, and meditation. These elements of health are the things that we all know we need to pay attention to, yet somehow when things are off it’s tempting to look for short term fixes with the idea that we can pay attention to those long term health issues later, you know, once we’re back on track. It’s advice we hear so often and is so basic that it becomes easy to tune out, and if you’re in a profession that involves lots of time staring at a screen like I do for programming it can be all to easy to let these things slide.

Short Term Fixes

These are the kind of things that I always hope will be the quick and easy fix, and I’ll sometimes go searching the Internet for the next one that might work rather than doing the work on the harder, less immediately gratifying long term fixes. So I try to remind myself that before I go trying 5 quick fixes from a clickbait headline I should just go for a run, put down the doughnut, and make sure to get a good night’s sleep.

But if I’ve been keeping a healthy routine, or I just need a quick win to jumpstart some productivity to get past a deadline I’ll try some of the following:


Almost too obvious to mention, I know. In fact, coffee’s not really my go to, I prefer nootropics which I find to be more effective with few side effects, but coffee is a stimulant that’s far more universally available. If you can’t function without it though, you’re probably sleep deprived and should focus on fixing that.


I don’t strictly adhere to Pomodoro, but the basic idea of structuring my time into short chunks makes it easier for me to make incremental progress. I find it especially useful when my “stuckness” is of the form that I can’t even seem to start.

Take Time Off

It might be an hour to take a walk (exercise added bonus) or a vacation if I’m nearing burnout. Of course, it’s always possible that I’ll feel just as stuck when I come back to the work, but if you have the luxury of walking away from things for a little while it can sometimes really help.

Rubber Duck Debug It

Sometimes just talking through a problem is enough to shake lose a solution, even if you’re talking to an inanimate object like a houseplant, rubber duck or whatever is available. If the inanimate object yields no good advice (maybe you should worry if it does yield good advice) talking it through with a real person can be helpful too. I like to start with the inanimate object so as not to waste people’s time if it’s something so trivial the inanimate object can help.

Eliminate Distractions

Is your Twitter feed really so important you need to check it every 2 minutes? Or worse you get a popup for every new tweet? Whatever your distraction, turn it off. Obvious? Yes. Easy to do? Not usually

Really Really Stuck

If you’re stuck to the point that you feel depressed get help. Sometimes you can’t bootstrap yourself out of your stuck state and you’ll need assistance and that’s OK.

About a year ago I started experimenting with nootropics, also known as “smart drugs”. These seem to be a hot topic among nerds, but very few people I know have gone beyond reading an article or two about them. It’s understandable why as there’s a lot of confusing information on the topic. The information that’s out there is often contradictory, and definitely not easily understood by someone new to all the drug names and terms. Some of the best info you can find is completely anecdotal with little in the way of scientific backing. It’s hard to tell snake oil from something amazing, and like most drugs what works for one person may have no effect, or worse, have negative effects for someone else.

Basically I’ve come to the conclusion that for the most part nootropics are a good thing if you’re careful and conservative in their use. I’m certainly not an expert by this point, but I’m glad I’ve taken the plunge in experimenting with them. The “stack” I’ve been using can greatly enhance my focus and concentration. It by no means seems to make me a lot smarter than I am without, and the main benefits really seem to be from what feels like increased energy. It’s like what you might get from drinking coffee, but without feeling jittery and dehydrated, and usually a longer, more even energy increase. Plus I don’t really like coffee.

The powders taste absolutely disgusting, mostly metallic. So I quickly learned that mixing the powder into water was not going to be sustainable and I needed to put them into pills. I bought a little pill machine to encapsulate the powders and it’s pretty easy.

Here’s the stack and measurements I use to fit everything into the pill machine I got, which hold 24 pills (all measurements in milligrams):

Both Morning Afternoon Servings Per Batch Both Total Morning Total Afternoon Total
DMAA 40 8 320
sulbutiamine 500 4000
caffeine 100 800
choline 750 6000
aniracetam 1000 8 8000
pramiracetam 250 2000
oxiracetam 900 12 10800
PEA 500 6000
10800 10000 16800
count capacity total batch capacity
capsules 24 500 12000

That table might be a little confusing, and is mostly split that way to get the measurements to work out to fit in the pill machine evenly. Basically I want to measure out a batch by taking as much of each ingredient as I can evenly fit into 24 capsules, so about 12g worth of power. However, some powders have much different volume than others, so I can fit 16.8g of oxiracetam + PEA in 24 capsules, whereas in general I can only fit around 12g of other powders. Therefore those measurements took a little trial and error to get right for batch size.

According to the above plan, in the morning I take 6 pills (3 pills containing 40mg DMAA, 500mg sulbutiamine, 100mg caffeine) (3 pills containing 1000mg aniracetam and 250mg pramiracetam). Then in the afternoon I would take 5 pills (same 3 as before of DMAA, sulbutiamine and caffeine) (2 pills containing 900mg Oxiracetam and 500mg PEA). Really, I rarely take both morning and afternoon doses, and usually just alternate days taking the Aniracetam + pramiracetam combo one day and the oxiracetam + PEA combo the next day.

I bought all these as a convenient stack from Build Your Own Blend on Amazon. I originally stumbled across this product in a comment while looking into buying those little 5 Hour Energy shots online, and this turned out to be much more effective and cheaper per serving.

I tried using to see if I could measure the benefit of the nootropics. There was a small increase in some mental abilities, I think it was mostly due the fact that I would take tests before taking the nootropics, then do better on the next round of tests because I had practiced recently. I also played with some IQ tests, but as I said before, taking these drugs didn’t make me measurably smarter, just better able to focus. Focus isn’t usually a problem for me while test taking, so if it is for others they might feel smarter just because they can complete material quicker.

One of the best informational resources about nootropics I’ve found is on Reddit. There’s a lot of info there, so if it’s overwhelming just see the what to try first section.

Update June 2014

The stack I purchased on Amazon is no longer available. Amazon seems to have stopped letting people sell nootropics on their site. I’ve reordered individual ingredients from Nootropics Depot as I’ve run out.

Also, DMAA is no longer sold at all for health concerns. I never megadosed DMAA so wasn’t concerned, but I don’t miss it much from my stack. I’ve replaced it to some degree with noopept, which has similar effects to the racetams. Noopept requires much smaller dosing, even smaller than DMAA, so requires careful measuring.

I also sometimes skip caffeine from my stack since I need to drink a lot of extra water with caffeine, and I build a tolerance if used consistently. The choline + racetams + noopept seem to be the ingredients that have the most effect, and the other stuff could probably be left out without noticing much.

I often go months without using any nootropics, sometimes because I just get too lazy to encapsulate a new batch of pills and partly because I don’t want to become reliant on any kind of drug. When I do use it though I feel a lot more focused, productive and motivated still.

I’m a little late to write this post since I’m already starting my second week, but I’ve got a new job with LivingSocial. I’m excited about the projects that I’ll have the opportunity to work on and they’ve been hiring a lot of really awesome Ruby developers, so I hope to learn a lot from my new coworkers. I’m in Washington DC right now for my week of orientation since that’s where the company is based, but I’ll be working full time in Portland still, in fact just 5 blocks from my old office.

Leaving Puppet Labs was a difficult decision since they’re a great company that’s also got a lot of great stuff coming down the pipeline. They’re improving, growing and innovating, and I wish them the best to continue to do so. They’ve got a lot of great people with more starting all the time – the company is many, many times the size it was when I started at around 10 employees. I’ll really miss being paid to work on open source software and doing so much work on non-web applications. I like web apps, but it’s certainly nice to do something else from time to time.

I’ll still be looking for ways to contribute to Puppet as I can, now as a community member – maybe I’ll finally finish that patch to have command line completion for Puppet – but first I’ve got a lot of new code to get familiar with.

Lately at work there’s been a bit of an obsession with metrics – I’m not sure it’s healthy. Code metrics can be interesting, but in the wrong hands or used the wrong way, they are misleading and harmful. It’s still to be seen what the outcome will be in this case. I’m more than little worried.

That said, even I like to get some numbers on code, especially unfamiliar code, to help me figure out a few things. For example, I’ve been using CLOC (Count Lines of Code) for years to find out quickly how big a project is and what languages are used in what proportion.

The first metric that’s started to be tracked at work is lines of code added and deleted per release, per author. I’ve occasionally glanced at these kinds of numbers in the past too, and even wrote a little script (git-rank) to get the same kind of info when I was on a code deletion spree. I’ve found these numbers to be useful for getting a general idea of who is most knowledgeable about a project or some files within the project.

However, the numbers can easily be misleading. For example, if someone is committing a lot of style reformats, vendoring code from other projects, or autogenerating documentation, their numbers will be very high but they may know very little about the codebase. For example, for a release to a Rails project I’ve worked on the metrics gathered showed that I had added 248,475 lines and deleted 458,020 lines. That’s obviously suspicious, although it does make me look very active. These are the kinds of numbers that you should dig a little to figure out what’s happening, which is why I wrote my little git-rank script makes it easy to break those line totals down by file, and then exclude files for the next count.

$ git rank v1.1.1..v1.1.9 --all-authors-breakdown --author "Matt Robinson"
Matt Robinson         603061
                      1 vendor/gems/json_pure-1.5.1/tests/fixtures/fail14.json
                      1 vendor/gems/json_pure-1.5.1/tests/fixtures/fail12.json
                      1 vendor/rails/railties/test/vendor/gems/dummy-gem-a-0.4.0/lib/dummy-gem-a.rb
                      21418 vendor/gems/haml-3.0.13/lib/haml/precompiler.rbc
                      24953 vendor/gems/haml-3.0.13/test/sass/engine_test.rbc
                      30038 vendor/gems/haml-3.0.13/test/haml/engine_test.rbc
Matt Robinson         603061`

It’s pretty obvious that most of what I did was update vendored gems. If you’re trying to figure out who did the most work between the releases I specified, you probably want to ignore the vendor directory when count lines of code.

$ git rank v1.1.1..v1.1.9 --exclude-file vendor
Josh Cooper           4
Nigel Kersten         8
Andreas Zuber         11
Michael Stahnke       11
Jacob Helwig          15
nfagerlund            37
Daniel Pittman        283
Max Martin            418
Nick Lewis            543
Randall Hansen        901
Pieter van de Bruggen 1018
Matt Robinson         1661

Now we’re starting to get a more realistic picture. From here we could dig deeper by listing all the files again for all the authors, and then maybe start excluding lines based on a regex if there were automated changes, and then maybe look at additions vs deletions in the count (I’m summing them together for these numbers).

However, I hope people never think they can get the whole picture, or even most of the picture, of a code base and who is contributing the most from something as arbitrary as lines of code counts. I feel like that’s almost too obvious to say, but I’ve heard horror stories of managers who tie reviews to metrics like this. I hope I never personally experience such a thing.

P.S. If anyone tries using the ‘git-rank’ project I mentioned above, please keep in mind it’s a hacky little sick project that is probably got some bugs and you should take the numbers is spits out with a grain of salt. What a weird phrase that is.

When I first started working for Puppet Labs, one of the main reasons was that I would get to contribute to open source software as a full time job. However, for much of the summer and fall I was leading a team to create a closed source feature built on top of the open source projects in the Puppet ecosystem, and it turned out pretty well if I do say myself – Live Management. It’s a web app addon to Puppet Dashboard that exposes the command line interface of the cool server orchestration framework MCollective. MCollective lets you execute commands on large numbers of systems in parallel, including doing things like triggering Puppet runs, starting and stopping services, or gathering lots of realtime information about your infrastructure from Facter. It’s like the big red button for your entire infrastructure: so easy to use even your manager can now blow up your infrastructure with a few clicks.

Besides building on the open source Puppet projects of Puppet, MCollective, Puppet Dashboard and Facter, we also used a ton of other open source software directly: Rails, Sinatra, BatmanJS, JQuery and many more indirectly. One of our team members pvande was able to contribute a lot of code and help back to the BatmanJS project – we had to since it’s alpha software and we were using it in a commercial application.

As I worked on the project, I sometimes felt sad that it wasn’t being open sourced. I knew the rationalization that at some point the company has to make a product that people will pay us money for, but that wasn’t the rationalization that helped me accept it most at the end. What helped was knowing that by building on top of other open source projects, we ended up contributing a lot back to them. Puppet got bug fixes and small new features to help us manage resources, MCollective got plugin improvements and feedback on how it can better support web app use cases and scale testing, Puppet Dashboard got some CSS cleanup and UI improvements, and BatmanJS got lots of real world use, feedback and code.

Besides, it’s free to try out for fewer than 10 nodes, and since it’s written in interpreted languages, people can view the source code if they really want to. There’s nothing stopping someone from writing a similar thing open sourced, and now we’ve done some of the hard work of improving the platform they would also build on. This does mean that we’ll have to continue to innovate and improve on our closed source features that sell product, but also on our open source platform that enables anyone to build their own features make their life managing systems easier.

I’ve been using GNU screen for years now as a way to deal with all the terminals I need to use at once (terminal multiplexing is what I talk to my wife about when I know she doesn’t want to hear about work). I started out using it, as many do, because I needed to do some work over ssh on a remote terminal, and losing that connection was painful without using screen. After getting used to it, I found I liked using it even when I wasn’t working over ssh because it gave me a way to easily manage a bunch of terminal sessions.

Then one day I wanted to do remote pairing and had heard of people doing this in screen. It’s a bit of a pain to setup with screen (shared login or chmod to set uid bit), but then I discovered tmux – and realized how many things screen didn’t have that I now don’t want to live without. The main thing being vertical splits. I used to think vertical splits were just for vim sessions, but I was wrong. The tmux faq has a much fuller list of differences from screen that are nice (auto naming windows, more intuitive help, easier multiuser, multiple sessions). In tmux vs screen tmux wins hands down. The only things I’ve found I miss about screen is that my vim sessions were part of the scrollback buffer, but in tmux they disappear from tmux’s scrollback when you exit vim.

Why not iTerm2, Terminator for Gnone, other OS specific terminal app here? Did I mention they’re OS specific? I want a terminal solution that works on any terminal the same way, and over ssh connections. Oh, and open source and BSD licensed is nice too even if I never look at the source code.

I’ve been meaning to write this post forever, but once I started doing what I suggest here it seemed so obvious that I have trouble remembering what life was like before I did it. Once you’ve been working in a terminal for long enough, you realize how much more productive you can be with your aliases, scripts, prompts, plugins and other configurations setup the way you like. This becomes especially apparent when you either work on someone else’s machine, or something happens and you have to rebuild yours and you realize just how slow you are in comparison.

How do you avoid this slowdown and prevent loss of all those great hacks and configurations you’ve built up? Version control all the files that enable your productive environment. Here’s my repo for all those files.

I’ve got bash, zsh, vim, screen, tmux, irb, tmux, irssi, ruby scripts, puppet scripts and more in this git repository. I spend a lot time working remotely via ssh or on virtual machines on my development box, so it’s important not only that I have these files available, but I also have a fast way to get all these files in place quickly. I also want changes that I make to these files to be easy to commit back to my repository. To accomplish this, I make all these files symlinks to the files in my repository so that if I edit ~/.bashrc with my great new alias that saves all sorts of typing, it’s actually editing the .bashrc in my git respository. Then I have a little perl script that when run puts all these symlinks in place for my automatically and backup up any files I’m moving out of the way to create the links, just in case.

Now whenever I end up in a new environment on the terminal, I can get all my productivity in place with a few simple commands from the home directory.

git clone git://
source .bashrc

Now vim has my plugins and configuration, bash has my prompt, if GNU Screen or tmux are available they’re how I like them, my aliases work, etc. There’s always going to be tweaks necessary for this to work cross platform and on different machines with different privileges, but since committing those changes back to the git repo is so easy, it become a natural part of my workflow to have these incremental improvements to my work environment available everywhere I work.

I’m excited to say that I started a new job last week at Puppet Labs. This means I’m back to working with Ruby code (I don’t think I’ll miss Perl much), not going to be doing much web development and pumped to be working on an open source project. The development team is small and really smart, and it’s fascinating to see how things operate in a startup company that’s based on a widely used, mature code base with a lot of community involvement.

There’s a lot of new things to learn, and finally working on a Mac and retraining my fingers on where the control key is may be one of the hardest. Just kidding, although that has been more of my brain power this last week than I’d like. Some of the cool new areas I’m looking forward to exploring in Puppet include parsers (Puppet has it’s own language), client server models other than with a web browser and working with directed graphs (finally going to get a chance to use all that graph math from college).

I’ll miss my coworkers at Rentrak and wish them luck with their code. I’ll be going to Open Source Bridge next week, so I’ll see some of them there I assume.

I’ve run across Stack Overflow plenty of times in the last year or so while looking for answers, but until now I hadn’t been motivated to sign up and post questions and answers. I finally decided it might be a good thing to try out when I saw they had a jobs section, because presumably the company you’re applying to might be impressed with your participation on the website. So I signed up thinking I’d give it a try and quickly lose interest as I always have participating in message boards or IRC since I always found the signal to noise ratio to be very low.

However, the simple little reputation system they’ve implemented on Stack Overflow has kept me interested for a least a couple weeks – probably will for longer. The reputation points makes me feel like it’s a something of a game where I’m trying to improve my score. I’m just over 400 reputation, and have started to look around to see what silly little badges I might be able to easily earn. I’ve even put up one of their silly flair badges on this site for now. We’ll see how long that stays up.

In fact, I think the minor addition of these badges helps make the whole reputation system more fun than a lot of other web sites that do ‘points’ or ‘karma’ or something else to measure your participation. I’m specifically thinking of the Y Combinator Hacker News Site that has these points. I tried to get some for a while, but I feel like there’s too many people who just sit around posting links and spouting out useless comments all day to compete for mind share. Even stack overflow suffers from this a little bit, where often the first person to answer gets a ton of points even if a better answer comes along later. Overall though, the community feel is still really good and there’s a nice balance of users who have enough earned power to do things to organize the site, and users who just need an occasional question answered. I’ll have to remember this as resource when I get stuck on things.

Update – Jan 3 2010 – The initial fun has worn off some, partly because you have to be almost the first person to respond to questions to stand a chance of getting your answer accepted. I just don’t have the time to watch for new questions that frequently. What I will say is that there’s a treasure trove of great answers that I’ve been using as a resource more and more often. It’s hard to even come up with original questions to ask for points. Guess I need to start working on harder problems – or at least more obscure ones :–)