code et al
jordan at jordanhollinger dot com
powered by eridu

CSS Gaussian blur behind a translucent box

January 29, 2014 | css, html5

I normally write about Ruby or occasionally JavaScript. But recently I had an interesting experience in CSS land applying a (responsive) Gaussian blur over part of an image. You can see the result on BuckMeUp's landing page:

A snazzy effect, and it might be obvious to bearded CSS gurus. I, however, had to think about it quite a bit. Here's what I came up with. Criticisms welcomed.

read more →

If software had to disclose side effects

January 15, 2013

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.

read more →

Spared No Expense

December 24, 2012

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

December 21, 2012 | rails, ruby

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.)

read more →

Write better code by pretending you found it on Github

December 13, 2012

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.

read more →

Mortal Token, a library for generating self-destructing tokens

August 2, 2012 | ruby

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.

I began to wonder if there was a way to create "self-destructing" tokens which would automatically expire based upon nothing but their own value. No need to store them anywhere on a server. Give it to the client, get it back, and see if it still is (or ever was) valid. I couldn't find anything like this, so I came up with MortalToken...

read more →

Async, ajax uploads with HTML5

July 27, 2012 | ajax, html5, javascript

HTML5 is orange! 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.

Here, I'll walk though a more basic version...

read more →