Ben McCann

Co-founder at Connectifier.
ex-Googler. CMU alum.

Ben McCann on LinkedIn Ben McCann on AngelList Ben McCann on Twitter




Being on the computer forces your shoulders forward and together. A split keyboard helps bring your shoulders back into a natural position. I recommend the Kinesis Freestyle 2, but there are quite a few alternatives on the market like the Ultimate Hacking Keyboard and KeyMouse. There’s a lot of research about how sitting all day Read More

How SBT does dependency resolution


SBT uses its own fork of Ivy to do dependency resolution. The code to do this resolution is split between a few classes such as ConvertResolver. I’ve posted below an excerpt of what SBT does. It uses a chained resolver, which I’ve simplified here to use a single resolver for demonstration purposes. IvySettings settings = Read More

Setting up Mac OSX


Install Homebrew. It will fail to install packages by default due to issues writing to /usr/local. To fix this: sudo chmod -R g+w /usr/local Make hidden files visible in the Finder: defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder Change the following settings using the Mac system preferences to make the trackpad usable: Key Repeat – Read More

OAuth in a command line script


Many APIs today use OAuth. If you want to use an OAuth API from the command line, then what I recommend is starting a web server locally to handle the OAuth callback. Here’s a quick and dirty example of doing that in Python. #!/usr/bin/env python from flask import Flask,redirect, request import json import logging import Read More

Building Docker images with SBT


A typical way to setup Jenkins is to connect it to your source repository (e.g. with the Git Plugin), run your tests after each commit, and then build a package for deployment when the tests pass. We’ll use SBT’s sbt-native-packager for this last step, which allows you to package your applications in numerous different formats Read More

MongoDB data migration


Here is some benchmarking data regarding transferring data from one machine to another. These benchmarks were run on the AWS i2 instance class. mongodump – 15min / 100GB gzip using pigz – 15min/100GB network transfer – 20min/100GB extract archive – 30min/100GB mongorestore -j 12 – 2hr/100GB

Injecting JUnit tests with Guice using a Rule


GuiceBerry is a pretty helpful library for injecting JUnit tests with Guice. However, it’s not super actively maintained and many of it’s methods and members are private making it difficult to change it’s behavior. Here’s a class, which essentially does what GuiceBerry does in one single class that you can edit yourself. import org.junit.rules.MethodRule; import Read More

IntelliJ Setup


The font rendering on IntelliJ is horrendous and makes you want to gouge your eyes out. This is because is uses Swing. In order to make this not completely horrible, you’ll need to install tuxjdk, which contains series of patches to OpenJDK to enhance user experience with Java-based and Swing-based tools. I also recommend installing Read More

Formatting a Disk on Amazon EC2


The following commands will format and mount your disk on a newly created EC2 machine: sudo mkfs -t ext4 /dev/xvdb sudo mkdir /storage sudo sed -i ‘\|^/dev/xvdb| d’ /etc/fstab # delete existing entry if it exists sudo sh -c ‘echo “/dev/xvdb /storage ext4 defaults,nobootwait,noatime,nodiratime 0 2” >> /etc/fstab’ sudo mount -a



Here are some things I consider when designing a web API. Consider using the following response code: 200 – OK 400 – Bad Request 500 – Internal Server Error 401 – Unauthorized (i.e. authentication error) 403 – Forbidden (i.e. not authorized) 404 – Not Found Version your API Use limit and offset for pagination Return Read More

Older Posts