Archives for posts with tag: mac

Icons that are different sizes cause problems when you’re working on an app, but don’t want to spend multiple hours individually adjusting padding around each image. So I created a script that uses ImageMagick to size a batch of images to the same dimensions. To prevent clipping, I note the maximum width and height of each image in the batch before running the script, and supply this as my desired-size:


# Name some args

# Gotta have some parameters to continue
# First parameter should be image dimensions, i.e. contain 'x' in the middle.
if [ -z "$FINALSIZE" ] || [[ $FINALSIZE != *x* ]]; then
	if [[ $FINALSIZE != *x* ]]; then
		echo "desired-size not given!"
	echo "usage: desired-size file [file2 ...]"
	echo "         desired-size: Desired image dimensions, e.g. 164x120"
	exit 1

# Make sure we've got the magic butter
hash convert 2>/dev/null || { echo >&2 "MISSING convert COMMAND! INSTALL ImageMagick TO CONTINUE."; echo; exit 1; }

for INFILE in ${@:2}; do
	FILENAME=$(basename $INFILE)

	# Do the stuff
	# If your grays are fine, use this. Otherwise comment out, and use command below.
	convert $INFILE -background transparent -gravity center -extent $FINALSIZE $FILENAME

	# Sometimes this script messes up grays in your PNGs. If so, uncomment this:
	#convert $INFILE -define png:big-depth=16 -define png:color-type=6 -background transparent -gravity center -extent $FINALSIZE $FILENAME

Also on GitHub.

You could probably also modify this to find the correct dimensions based on the images you provide.

This script is meant for PNGs, but can easily be modified for any other image type, like a JPEG, by giving something other than transparent for the -background argument.

Known issues: I occasionally noticed that gray-colored icons got darker after running this script. After searching around, the commented-out convert line solved my problem. Utilizing it increases the file size slightly, but without a finer knowledge of PNGs, this was a quick and easy solution.

$ logout

I love working from the command line. And while I can quickly open and hack away at any terminal in Ubuntu, I noticed a laggy experience on my MacBook Pro in iTerm2. Typing commands didn’t bug me as much as editing in vim, which would slow considerably when scrolling through a file.

I tried changing the font and upping the keystroke repeat rate (which needed to be done anyways), but all to no avail. It wasn’t until I plugged in a second monitor that I noticed the real issue: my Retina display; iTerm was snappy on my non-Apple 1080p monitor.

It looks like this has been an issue for a while. For now, it’s back to for me.

$ logout

People like to get their petticoat ruffled over this issue, but I don’t like to start the platform bashing simply because I have an opinion. I think more people should realize that the reason they generally pick an OS (including mobile OS) is purely on preference. Other times, it’s just best for you.

After surveying the field of OS’s, Ubuntu fits me best. I’ve had the joy of using it regularly since I bought a $300 Samsung netbook with the joke that is Windows 7 Starter Edition on it in 2010. I went into that purchase blind– I only wanted a small computer to bring to class for note taking. When I realized I couldn’t even change my desktop background (among other atrocities), I wiped the hard drive, installed Ubuntu 10.04, and fell in love. In July I bought the Gazelle Professional from System76 (who, for the uninitiated, sells hardware with Ubuntu pre-installed)– best computer I’ve ever had.

As I programmer especially, I love this OS. The community behind it is amazing, and has always helped when I wanted to tinker. I love the extent to which I can customize everything, and when I need to do something quickly, I can pop open the Terminal to issue a few quick commands. Also, if I’m in less of a hurry, the GUI doesn’t stop me from doing the same things. Finally, on principal, I like to support free software (free as in “free speech”), and Ubuntu / Linux helps me do that.

Mac OS

I’ve had the pleasure of working with Mac OS X sparsely over the past four years in school, and post-graduation for iOS app development with my software company. Before college, my last interaction with a Mac was Word Munchers on OS 9, if that tells you anything.

Despite my still-limited interaction, I can see the appeal it has to most people. But as a developer with the need to work with this OS, it was initially frustrating (especially Xcode). Most frustrating was the OS’s “quirks,” like how the Home / End keys control window navigation (beginning / end of document), not the cursor (beginning / end of line). Or having to go into the Terminal to show / hide hidden files. And I’m not a fan of the document-based rather than application-based window management, especially for programs like web browsers. And Xcode– ugh.

These are minor complaints. Ultimately, my gripes are its incompatibility with other systems in what usually comes off as an attempt to be overly esoteric, and Apple’s walled-garden approach to everything (like developing iOS apps).


I grew up on Windows, and to say that fact alone wasn’t formative would be willfully ignorant. But I learned HTML and started getting into programming and doing gif-animated cartoons around the turn of the millenium– and did it all on Windows. However, I remember questioning this fact when interacting with Windows 2000 for the first time, and it’s been downhill since then (plateauing, maybe, at the precipice of XP). But as the internet grew, and I grew, I stopped using IE for Firefox, learned bash instead of DOS, and now my only need for this OS is the occasional website-in-IE test or quickly laying down a beat in some music software.


Avoiding the minor gripes, I need the following out of an OS:

  • Quick task-switching between large numbers of applications (why I prefer Windows / Gnome’s way of keeping windows over Unity / OS X)
  • General UX conventions followed or improved upon
  • Freedom to modify / improve / destroy the system myself
  • Not to feel like I’m constantly being sold more crap

Ubuntu delivers.

matt@wp:~/Documents$ logout