A Gentle Introduction to CarrierWave

Let’s see this modularity first hand by building up a CarrierWave uploader from scratch.

To begin with, we’ll install CarrierWave:

  gem install carrierwave

Then, we can make the world’s shortest uploader:

  require 'carrierwave'

  class MyUploader < CarrierWave::Uploader::Base
    storage :file
  end

Even at this point, we can start saving files:

  file = File.open('example.jpg')
  uploader = MyUploader.new
  uploader.store!(file)

[snip -ed]

If you’re ready for more, check out:

I’m sure you’ll enjoy using CarrierWave as much as I have!

[Nice.]
Source: Union Station

Traveling With the MacBook Air (James nails it)

Traveling With the MacBook Air:

On my way home from the UK last month, I posted about my dream to travel light. As it turns out, I didn’t wait too long to start implementing it. I haven’t picked up an X100—though I have been frequently checking the various camera stores. I have, however, acquired a 13″ MacBook Air and have been using it as my only computer for the last week while on a trip to New York.

My 13″ MacBook Air in flight on CO 1585 from Newark NJ to Portland OR.

As a general-purpose laptop, the new MacBook Air is as awesome as everyone says it is. Lightweight, surprisingly speedy, and gifted with impressive battery life, Apple’s marketing is dead on. It is the perfect everyday laptop for most users. But what about for using it for something more demanding? More to the point, the question you probably have for me is: How well does it work as a laptop for a photographer?

The answer is that as long as you can live with its limitations, it’s a surprisingly decent travel photography laptop. I’ve totally enjoyed it while working on planes and trains and in cafés. It’s done everything I’ve asked it to since I bought it, including working through my photos and posting a few along the way. I even used it for light client work while in New York where I needed to quickly shoot a few dozen images and then deliver a finished photo on the spot.

So what are the limitations of the Air? One is the lack of a discrete GPU. This affects applications that can take advantage of it, like Aperture. In my experience so far, it’s most noticeable when importing a big set of photographs and waiting for the initial churn of preview generation to finish. Also, judicious use of Preview mode is called for when browsing photos. If you’re using Lightroom or other applications which only hit the CPU, however, you won’t miss out on the acceleration you didn’t have to begin with.

Another limitation is the speed at which you can get data on and off the MacBook Air. Without using a Thunderbolt display or a huge Promise Pegasus disk array, the current choices are USB 2.0 or WiFi. This means a bit of patience is required whenever you’re making big data transfers, such as to push a big set of photos from the laptop to desktop once you get home after a trip. This limitation should ease as more Thunderbolt options arrive—I really would like a Thunderbolt port expander with Gigabit Ethernet and FireWire on it—but that will take time. For now, it’s a bottleneck that has to be dealt with.

The bottom line is that if you need a single computer for your photography and it has to be a laptop, you really should be looking at the 15″ MacBook Pro. The quad-core CPU, the discrete and fast GPU, the ability to use 8GB of RAM, and the external port options are all extremely useful on a primary photography workstation. On the other hand, if you have an iMac or Mac Pro where you do the bulk of your photo processing, the MacBook Air serves as a great lightweight companion to take on the road. And for all those non-photographic things you do while traveling—email, web browsing, writing—the Air is a shining star that’s a joy to use.

Posted by
James Duncan Davidson.

[I have nothing to add. He’s right on the money. Photography is not a main use, but if you insert almost any other processor intensive task, it applies. The Air is a great general purpose machine that is good enough to squeak by on “Pro” tasks, but you’ll need a MBP for day in day out work… at least until companies start churning out Thunderbolt based extenders.]
Source: James Duncan Davidson

So there I was, riding along…

No really. I was.

I was up early and out the door. My hands hurt form the cold on the run down 202 to Route 17. The climb up to Mountainview felt good. The quiet, sun, general peacefulness did my head and heart good. I passed the giant mountains of organic waste composting away, amazed at the height of the piles.

I turned the corner onto 17a feeling good. It’s a been a crappy season overall. I haven’t coordinated my riding very well. Never found the pocket. Each ride is a struggle to get out the door, and none of the things I wished to do have been done. It goes that way sometimes. I can let things go. Breathe.

This morning I was the breakaway. Out front, nose in the wind. Making my way. The peloton of worries and concerns was not far behind and chasing hard. But whatever inevitable catch was waiting me, for now I was off the front. The time, the wind, the sunshine, the birds, and views were all mine.

I hit the backside of Harriman and the long climb up from the valley. My knees took turns hurting, but remained manageable. I have the the final bit of climbing almost in sight when I hear a now familiar sound of a spoke breaking. I pull over, off the road, I hold up my hand. Nothing. There’s never a team car when you need one. Wait… who’s this? An old guy in a green truck pulls up. “You gotta problem?” Yes. A broken spoke. “Can’t help you with no spokes.” Thinking to myself… Offering me a ride was prolly not on your morning to do list. But it was fun to think that holding my hand up caused him to stop in the first place.

Since it was the front wheel this time I decided to wind the spoke around another and remove the brake pad holders to give the untrue wheel room to rotate. Sure, I could have made “The Phone Call”, but that sucks for everyone and it was only about 12 miles to home. Riding slowly and gently I made my way up the rest of the hill to the next circle.

Ran in to a frightfully cheery Aussie who was way too fit, asking about the road I just rode up. He seemed delighted that it went through to 17, and that it was essentially downhill all the way. His happy mood was not a match for mine at the moment.

As I tackled the last climb I realized sadly that I was going to miss out on the downhill. Not only would I have to work to keep my speed down on the gentle slopes, but the real plummet down into the valley would be crazy reckless on a weak and wobbling wheel and no front brakes. Imagine the ignominy of clomping down a hill. Oh agony, agony.

I finished up about 25 minutes later than I thought I would, happy that I hadn’t collapsed the wheel riding home and ruined anything else. Some small pride that I finished what I started.

I thought of Seth while all this was going on. He had a run in with a car at 25mph and who’s now working on replacing his bike (and that is no picnic for someone as tall as he) and glad for him that nothing really bad happened to him, just his bike.

All the crashing in Le Tour this year makes me concerned. But then I go for a ride…

100 Miles of Nowhere 2011

For the last few years one of the annual rights of spring has been to raise money for charity by doing something ridiculous on my bike… namely riding some crazy distance in very small circles. Yesterday’s circle was a 1/4 mile… round and round at the Kissena Park Velodrome in Queens.

Kissena Park Velodrome

Though serious looking at the start, with early laps and other athletic looking gestures made, the hilarity was not far behind. First we were buzzed by the locals who happen to get out early and fly their radio controlled airplanes, helicopters, and whatnot, doing loops and aerobatics not far over our heads. The wind, which became a constant companion started to create the home straight headwind. And the track was far bumpier than I would have thought a track would be, except this is a public park, in NYC, and so I should have known better.

Carlos and Jamieson warming up

There were piles of food (this was Team Fatty event afterall) and enough spare tires, tubes, pumps, water, etc. to keep a small race team in good shape for a half a season.

Round 'n round

So in typical Team Fatty fashion, there was joy, and unending laughs, and the insanity of riding (in my case) a metric century in 1/4 mile circles (I did 250 laps…)

Busy Developers Guide: CoffeeScript

Please note that these instructions are for busy developers, and assume that you are one. If so, this should help, if you’re not, these may not. Sorry about that. Below are the steps I used…

  1. First get npm (the node package manager).
  2. You’ll find a one line install such as this or similar: curl http://npmjs.org/install.sh | sh
  3. Next CoffeeScript: npm install -g coffee-script (Leave off the -g if you don’t wish to install globally.)
  4. Assuming that went well you should be able to type “coffee” on the command line and see a "coffee>" prompt.
  5. Pat yourself on the back and start developing! But wait, a little more structure might help… You can skip the steps below and check out the repository.
  6. Create a new folder and get it set up as a repository. For me that looks something like this: mkdir ~/code/learning_coffeescript; cd ~/code/learning_coffeescript; git init;
  7. Create some files a bit of structure. A top level public directory and src directory. Inside public I created a lib dir and an index.html file.
  8. The index.html file contains a base html 5 template, and in my learning case it included a line pointing to the hosted jquery.js lib, and our newly compiled javascript file (yeah, I know, patience… I’ll get to it in a minute.)
  9. Back in the terminal, at your project root, type coffee -o public/lib -cw src which will compile all the CoffeScript files written in src into javascript in lib. It is “watching” the src files timestamps so if you update and save a file it will recompile.
  10. Assuming you’ve got everything wired up correctly, you can fire up a browser, open the index.html file and go to town.
  11. If you want to get snazzy you can rackup file_server.ru -p 1111 and the project will run under a basic Rack file server.
  12. If you wish to be all hip and edgy you can download and install Pow, symlink your local clone of the repository and develop to your hearts content.

Feel free to make pull requests, or send me issues, updates, or notes. I’m sure I have a lot to learn about CoffeeScript how best to integrate it with jQuery, etc. In the end though, I’m enjoying the syntax. It was just not clear how to get a project going. Next I’ll be looking at testing…

What just happened?

Just a few seconds ago it was February. Now it’s April. What the…!

I started writing this yesterday morning, but well, that’s exactly how things have been going. It’s been busy, happy, troubling, joyous, and filled with code. Lots of work. Plenty of Noah time (yay!). Not enough time with Lisa (boo!). A small amount of riding around the edges.

On the tech side, I’ve been digging more deeply into Redis. A wonderful tool added to my kit over the last year. I still feel like I’m just grazing the surface here.

After many years (not since her wedding?) I had a chance to grab lunch with Lynn, a friend since college. Unbeknownst to either of us, that was a Long Time Ago™. Really nice to see her. lynn and me

More soon. I’ve got two really cool rides coming up.

Caps? Folks, please.

I was working on a longish piece about the “helmet good/helmet bad”, “wear one/don’t wear one” thing.

Sparked by this piece and then compounded by this, where he writes of Alan Colville’s disaster.

But I’ve decided not to because a lot of these things are over thought, and over wrought.

I dig cycling caps. I love riding without a helmet. I almost never do it anymore, but there are times when I do. And maybe the helmet will help me out one day, or maybe it’ll never make a difference or worse. Growing up, no one rode with a helmet, certainly not I. Now everyone does. Sometimes, I don’t want to, but mostly I do.

What changed my mind about writing about this in more depth were pictures I saw from around the world where folks were riding with various helmets, hats, nothing, watch caps, etc. and everyone was managing. The only unifying thread was that they were all on bikes, doing their thing.

So do what you think is right, and let’s stop turning these things into more than they are.

Be safe.

764821

Thoughts for a Monday morning…

  • Ignore Your Critics
  • Turn the Ordinary into Something Beautiful
  • Justify Your Price
  • Communicate in the Language of Your Audience
  • Extend the Experience
  • Build a Tribe
  • Become “The Name”
  • Do what you think is best.
  • Go with your instinct.
  • Take risks that quickly display failure or success, you can learn from either.
  • Don’t be afraid of consequences. Everything has them.
  • Prioritize your endeavors.
  • Sacrifice is a necessity.
  • Enjoy your successes. Celebrating what you’ve done will only lead you to yearning for more.
  • Always ask: “What might lie over the horizon?”

Sempe21

We all drop things off our bikes… please be careful.

Untitled.png

It is a natural reaction to stop and retrieve an ejected item… a light, a bottle, a speedo. Sometimes because you need the drink, bike comps are not inexpensive, you want to remain visible… all valid reasons. But it’s easy to be hypoxic, or distracted enough as you’re turning around to forget that you’re still traffic.

Sadly that seems to have happened to 23 year old Carla Swart today while doing intervals. RIP, and the best to her family, friends, and teammates.

I’d notice this “suspension of attention” a while back and made it a rule for myself that I’d get off my bike, and walk back to retrieve whatever fell. It’s enough of a break to help prevent this failure. Even having the rule is a help, because at times I have turned around and ridden back, but not without having to think “Hey, you’re supposed to walk it back…” which reminds me why I have the rule in the first place and helps keep me safe.

I hope it’ll help you too.

[As an aside, my road bike position seems to offer up gobs of toe overlap, so “hangin’ that u’ey” is ripe with opportunity to flop over. Yet another reason to think twice before I attempt that little wonder…]