Posts about Hacking

Jun 21, 2010

Opticrop: Content-aware Cropping with PHP and ImageMagick

Opticrop is a PHP script I wrote to crop a thumbnail of a specific width and height from a full-sized image. Unlike most cropping routines out there, Opticrop uses edge-detection to find the most “interesting” part of the image to crop, so you won’t get a useless thumbnail just because the top-left corner of your (More…)

Opticrop: Usage and Implementation

Opticrop is a PHP script I wrote to crop a thumbnail of a specific width and height from a full-sized image. Unlike most cropping routines out there, Opticrop uses edge-detection to find the most “interesting” part of the image to crop, so you won’t get a useless thumbnail just because the top-left corner of your (More…)

Mar 21, 2010

Preserving reply structure when importing comments with Disqus API

This post is a tutorial on how to migrate comments from JS-Kit Echo into Disqus using a Python script. Most importantly, I’ll show you how to recreate the reply structure of threaded comments and preserve that in the migration. As usual, I need to first ramble about the inconveniences that led me to write this (More…)

Feb 26, 2010

Using Gmail to send / receive emails on a different account (super complicated version)

UPDATE 3/8/2010: There is actually now a “Refresh POP” feature in Google Labs, which mostly removes the need for this hack. But check it out anyway, if you want to see some potentially useful tricks with Gmail/cron. I love Gmail. It is simple, and I can do things with it that would usually take 10 (More…)

Sep 29, 2009

More software frustration: Google Chrome doesn’t load any pages, displays blank screen

So I’ve actually been experiencing this problem for a few days, but I haven’t mentioned it because it seemed unsolvable. Unlike the WordPress bug earlier, though, I’ve now found a fix. See reader comments for some alternate explanations of this fix. Here’s the problem. A few days ago, Google Chrome stopped working on my laptop. (More…)