I recently switched from Thunderbird to Mail.app, on my MacBook Pro. For years, I’ve been appending random fortunes to the bottom of my email messages, and I wanted this feature for Mail.app, too.
Hacking Buildr’s POM Generation
Awhile ago, I finally decided to bring the build process for one of my open source Java projects into the 21st century. Since I find Maven irritating, I converted the project to use Buildr, a Rake-based build tool that contains, among other things, Maven-style dependency management.
Life was good. I had a nice, simple build, with all the power of Ruby at my disposal, and without any need to edit XML, which sucks.
Then, someone reported a bug: The Buildr-generated POM did not contain dependencies. As the author of the bug report wrote:
Maybe they should be added to the POM, so my build system (I use Gradle) will be able to download all the required jars?
That, of course, is a perfectly reasonable request. As it happens, it was easier requested than accomplished.
Using Twitter Bootstrap with Jekyll
Introduction
I use Jekyll to generate more than a few web sites. I like the separation between the HTML presentation and the Markdown content, and I like that its easy to migrate Jekyll web sites to and from GitHub Pages.
Recently, I decided to update one of those web sites, partly to take it out of the dark ages, and partly to learn more about Twitter Bootstrap. Twitter Bootstrap is a terrific package, consisting of Javascript, CSS and HTML that is relatively easy to use, flexible, and customizable.
A Case for CoffeeScript in the Browser
Like many others who do some development for the web, I’ve grown to like CoffeeScript. The CoffeeScript package comes with a Javascript implementation, allowing CoffeeScript to be translated into Javascript directly in the browser. Jeremy Ashkenas, author of CoffeeScript, recommends against using that approach for anything serious, and with good reason. However, there’s one scenario where I find CoffeeScript in the browser to be especially useful.
Simple Address Standardization
Introduction
Suppose you’re writing an application that stores and compares street addresses. Depending on how you obtain those addresses, you may need to standardize them.
- Standardizing the addresses makes them easier to compare.
- Standardizing the address can have the side effect of validating the address.
- Standardizing an address also makes it more likely that you can send a physical piece of mail to the address and have it actually arrive.
This article explores one way to solve that problem. I’ll be showing examples of Ruby and Python, but the same general approach works for other languages.
A Sublime Text 2 Plugin to Set the Syntax from the File Name
A few months ago, I switched from GNU Emacs, which I’ve used for more than 20 years, to Sublime Text 2. After years of using Emacs, there are a few things I miss in Sublime Text 2. Fortunately, Sublime Text 2 has a rich Python API, and it supports plugins; so, it’s relatively easy to add features I miss.
Like all decent modern programming editors, Sublime Text 2 supports syntax
highlighting. But, for various reasons, it can’t always guess which syntax
applies to a file. For example, lately, I find myself editing a lot of Sass
files. Sublime Text 2 always brings Sass files (i.e., files ending in .scss)
up as plain text files, with no syntax highlighting. I wanted a way to tell
Sublime that all files ending in .scss should be assigned the “Ruby Sass”
syntax, by default.
In other words, I wanted the equivalent of this Emacs Lisp capability:
1
| |
A Simple Octopress Image Popup Plugin
Introduction
Octopress does a good job of generating a blog that scales nicely for large computer screens and smaller devices (such as my iPad). However, it’s possible to thwart Octopress’s best intentions, as I inadvertently managed to do.
I occasionally post cartoons to my blog, and the images tend to be large enough that they flow outside the boundaries of the blog’s text area, which looks like crap. My first attempt at solving the problem was to use CSS to set a minimum size for the text region. That solution, however, ruins the blog layout for smaller devices, such as a tablet.
There’s a straightforward solution to this problem, though.
The general idea is to display a smaller version of the image in the text area; when a reader clicks on that image (or taps it, on the iPad), the full size image appears in a modal popup. Many sites use this approach, of course, including Facebook and Google+. Its popularity is part of its appeal.
This solution can be implemented in a simple plugin, making it easy to drop into individual blog articles.
Generating a Table of Contents in Octopress
Introduction
I recently converted this blog from raw Jekyll to Octopress. Octopress uses Jekyll underneath, but it layers a large number of blog-friendly capabilities on top.
One of the features I need to rebuild for Octopress was the ability to generate a table of contents (like the one for this article), for some of the larger articles.
This article describes how I accomplished that goal.
Recursive Globbing Considered Cool
I’ve been using Unix shells for so long that I tend to get locked into a particular way of doing things. I first started using Unix in 1985, so I’ve used a lot of shells, among them the original Bourne Shell; the Korn Shell; the C shell (and its fork, Tcsh); and, of course, Bash.
Every so often, it makes sense to shake up the status quo. To that end, and based on some recommendations, I recently switched from Bash to Zsh. While reading the Zsh documentation, I found that it supports recursive globbing. (Actually, Zsh’s globbing features are even more powerful, but discussing all its globby goodness is beyond the scope of this article.)
Anyone who’s used Ant in the Java world is familiar with recursive globs.
With this feature enabled in Zsh (which is the default), you can remove all
files ending in .log in all directories in and beneath the current working
directory with one simple command:
1
| |
GoDaddy has lost my business
It was bad enough when GoDaddy CEO Bob Parsons killed an elephant. Many people decided to walk away from GoDaddy then, in protest. I did not transfer my domains at that time, preferring to wait until they expired, to conserve my cash flow. Plus, I will admit, I am not a fan of PETA. I don’t like PETA’s radical stance, and I have heard and read more than enough from Ingrid Newkirk and Dan Mathews. PETA’s response to Parsons’ elephant hunt was to organize a boycott of GoDaddy, and I dislike PETA enough that I have a knee- jerk, irrational reaction against participating in anything they sanction.
That said, however, Parsons’ explanation of his elephant hunt smacks of spin. His grand safari, and his politician-like response to the outcry, planted the seed of discontent.
GoDaddy’s most recent actions have caused that seed to sprout.
On December 21, 2011, Gizmodo published the United States House of Representatives Judiciary Committee’s list of supporters of H.R. 3251, the Stop Online Piracy Act (SOPA).
GoDaddy is on that list. GoDaddy supports SOPA.
SOPA is a very bad piece of legislation for the Internet. To understand precisely how bad it is, read some of the following articles:
- MythBuster Adam Savage: SOPA Could Destroy the Internet as We Know It (Popular Mechanics)
- All About SOPA, the Bill That Wants to Cripple Your Internet Very Soon (lifehacker)
- Stop the Internet Blacklist Legislation (Electronic Frontier Foundation)
- Google, Facebook, Zynga oppose new SOPA copyright bill (CNet)
- Please Take the No Go Daddy Pledge (Lauren Weinstein)
GoDaddy’s support for SOPA was the last straw for me. Today, I initiated the transfer of all domains under my control (both personal and business), from GoDaddy to another registrar. Like so many others on the Internet, I’m voting with my wallet.
GoDaddy will no longer get any of my business.
Update, December 23, 2011 GoDaddy has reversed course. In a flurry of disingenuous backpedaling, Warren Adelman, GoDaddy’s CEO, said:
Fighting online piracy is of the utmost importance, which is why Go Daddy has been working to help craft revisions to this legislation—but we can clearly do better. It’s very important that all Internet stakeholders work together on this. Getting it right is worth the wait. Go Daddy will support it when and if the Internet community supports it.
As Gizmodo’s Casey Chan put it, “If a sleazeball company like GoDaddy can ditch SOPA because of pressure from the Internet, you bet other companies currently supporting SOPA will cave too. Let yourself be heard and let’s freaking kill this bill.”
However, while I’m delighted that GoDaddy is responding to the pressure, I don’t trust that this reversal is anything more than panic and politics. I doubt that they have really realized the error of their ways. As Lauren Weinstein puts it:
Do not be fooled. Make no mistake about their motives. They’re not suddenly against the censorship principles of SOPA: “Go Daddy will support it when and if the Internet community supports it.” There is no indication whatsoever that they have had a fundamental change of heart.
I’m still not giving that sleazeball company any more of my money. My domains are on their way to another registrar.