Yesterday I was pulled into an alternate universe. In that universe, software companies were required to disclose any possible side effects associated with running their software, much like pharmaceutical companies in our universe. (Also, SOPA/PIPA had passed the U.S. House and Senate and were signed into law by President Donald Trump. Altogether not a pleasant reality.) Anyway, I brought back Oracle’s® list of Java™ side effects.
Spared No Expense
Having a wonderful Christmas Eve Day with Alicia. This afternoon we sat down to watch that old Chritmas classic, Jurassic Park.

The Perfect RSpec Config
Here is the optimal RSpec config for Database Cleaner, transactions, Javascript, and speed. This post assumes you’ve already got RSpec working, but you want to optimize your use of Database Cleaner.
Obviously you want to run all your tests in transactions but can’t, because you’re using Selenium, capybara-webkit, or something else that won’t work with transactions. Most advice tells you to just use Database Cleaner with truncation. That’s slow. Really slow if you’re working with a huge Rails app with hundreds of tables. (Yes they exist, because I work on one.)
Write Better Code by Pretending You Found It on Github
Lately I’ve been refactoring lots of code (both mine and others’), much of it Javascript. These areas of the code make up core features of the application. But I found myself writing them like stand-alone projects with hooks for the larger application. They may not be useful stand-alone projects, but I’ve found the mindset very helpful during development.
I am by no means suggesting that this mindset is anything new and extraordinary. But for whatever it’s worth, I’ve decided to outline my rational here.
Awesome Backups in Like 50 Lines of Bash
Apple’s Time Machine was a punch in the gut to all other desktop backup utilities. The time-stamped snapshots, hard-linking to save tons of space – it was just awesome. But at the same time, it was rather obvious.
It was so obvious that, like any good hacker (in the classical sense), I had to write one, too (sans the flashy GUI). I wrote it in Python and name it flux, and saw that it was good. Good at local backups, anyway. Backups to a remote server weren’t.
I knew that rsync was supposed to be awesome at backups, but only theoretically. I couldn’t find anything on using to it create Time Machine-style backups. So like any good hacker (in the classical sense), I got bored one Saturday and figured it out.
Writing a Successful Ruby Gem
Want to write a successful Ruby gem? Here’s how in THREE EASY STEPS!
Mortal Token, a Library for Generating Self-destructing Tokens
Warning, highly experimental I’ve recently been needing a lot of temporary tokens for various projects. These are small Sinatra app auth tokens, API auth tokens, and the like. They’re small, self-contained projects, and I don’t want the overhead of tracking and expiring tokens in a database or redis.
Async, Ajax Uploads With HTML5
Everyone loves Gmail’s async-drag-and-drop-with-progress bar attachment UI. While I’d heard that HTML5 supports this type of upload, I found myself sticking with the nasty old form submission model.
While writing a media manager for eridu, I decided to finally look into it. My research into the progress element, the drop event, and the FileReader object bore a tiny ~180 line Sinatra app. Download it, run ruby dropbox.rb, and you have a complete reference implementation of a Gmail-like uploader.
Introducing Graphene
Graphene is a new Ruby gem for transforming collections of Ruby objects into subtotals, percentages, tables and graphs. See the source code at github.com/jhollinger/graphene and read the full documentation at rubydoc.info.
Disable the Back Button Using HTML5
What do disabling the back button, the search for the Holy Grail, and the search for the Fountain of Youth have in common?
A. They have been made into major motion pictures
B. Many have died trying
C. They are impossible
D. This is stupid, get to the point
Fine, D it is then. Gee, lighten up will you? Okay, on to it then. Today while jogging, I received a text from a colleague who was looking for a way to disable the back button. I responded that I thought it was impossible, and continued running. However I tend to inadvertently solve coding problems while jogging, and the following idea came to me.