RSSAmplifier

Blog

Ben McCann

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

benmccann.comRSS feed ↗10 posts

Latest posts

Cheat sheet: modifying dates with exiftool

To view info for a file: exiftool -s -G myphoto.jpg To set the date based on the filename: exiftool -overwrite_original "-alldates filename" myphoto.jpg To set the date based on the XMP metadata date: exiftool -overwrite_original "-alldates MetadataDate" myphoto.jpg To set the date to a manually specified date if the photo doesn t already have a date: exiftool -overwrite_original Read More

Include CSS or JS first in your HTML page for best performance?

I was recently having a discussion with Rich Harris about performance optimizations for CSS and JS handling. A few questions came up for which I didn t have a good answer. One of those is whether the old advice that you should include and load CSS first in your HTML page for best performance was still Read More

Ergonomics

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