Highgroove Hack Night: KML Heatmaps

Every month, Highgroove hosts a hack night where we order food, stock up on beer, and invite anyone and everyone to come hang out in our office to work on cool projects. Last night was a pretty busy one with a handful of open-source gems getting updated, and between helping out other people and building Space Cthulhu I played with turning GPS traces of bike rides into a heatmap.

First up was getting coordinate data for the heatmap out of Google Earth. I put together a quick script using nokogiri and ruby to grab the coordinates from a kml file and output them to CSV:

This gets run like:

ruby mykml2csv.rb > coords.csv

Then, I used heatmap.py in python to generate both an image and a KML overlay:

This gets run like:

python csv2map.py

For my 2007 kml this was only ~3000 points and worked pretty quickly, but for 2008 there are ~60k points and I had to shrink dot size and bump up output size pretty significantly to get it to finish. csv2map.py ran for ~12 hours and finally outputted a pretty neat image:

Looks like I rode to Stone Mountain a lot in 2008. This could probably be generated in a few seconds with a more performant heatmap library, so perhaps I'll hack one of those together in the future. That said, this was a fun proof of concept and may be useful for people with smaller KML files than me! My entire my.kml has over 1 Million points, so it may never build a heatmap of all of them.

Building trails and IMBA Trail School

In December, I had a pretty nasty wreck on a night mountain bike ride in town. Once I was able to ride again, Bob and I went out and fixed a bunch of things including the "bridge" (first photo in the album) that I fell on. We've both ridden all the things we fixed a few times now and it's nice to know we made a difference. Nice! I spread the word that I'd like to do more of this, and got a phone call a few weeks later about some people working on some trails behind a friend's house in-town. Several hours later, we ended up with 3 new berms and a hundred or so feet of new rideable trail. Here's the fun part:

I showed up with far more tools than I needed, the wooden thing we made out of an old futon frame is almost certainly not going to last, and we'll see what work needs to be done due to the recent rain. But it was a blast, the berms are a lot of fun to ride, and we got in a nice ride afterwards.

Two weekends ago I attended IMBA Trail Building School as the IMBA/Subaru Trail Care Crew made their way through the southeast. A morning of instruction (proof) was followed by a few hours in the field at Allatoona Creek with a decent sized crowd putting in 700 feet of new sustainable trail. Photos: before | during | during and after:

Mountain Biking is the best kind of biking, and there is an unquantifiable great feeling of riding trails that your own sweat equity has gone into. Someone has to build trails, and the vast majority of mountain bike trails are built with a combination of volunteer labor and donations. If you ride on trails, you owe it to yourself to pitch in a little bit every now and then. If you're in Georgia, here's something you should do this Saturday: Bear Creek-Pinhoti Mega Work Party. These trails are some of the best in North Georgia and need a little bit of help!

LessConf 2012

This past week, Highgroove sent me to LessConf to learn the secerts of successful startups. LessConf is a little different from other conferences in that they don't publish the speakers or sessions ahead of time, and instead require that attendees be willing to laugh, high five and hug one another, and learn new things.

There were a wide variety of speakers, all of whom were somehow successful in starting something new. Presentations were poignant and informative, and the interview style questions from the conference organizers after each speaker were fantastic: "Are you successful?", "How much money do you make?". Everyone had a great story and loves what they are doing: from the guy that started an organic kid's snack company (Little Duck Organics) in his basement that is now in over 3000 grocery stores, to the guy that started Mental Floss, to the husband-wife team that run Freckle and a handful of other business and is starting up a new community: Bacon Biz (which is a better name for 'lifestyle businesses' with better connotations). All are now pretty successful and speakers were making anywhere from "a founders salary" to upwards of $500k a year doing things they love. It also seems that everyone reads Hacker News.

Inbetween talks were delicious food, all the Capri Sun I could drink (which, for the record, is a lot) and various competitions to win iPads/Kindles/etc. "Who want's an iPad? On stage!" -> You might be stuck doing the Limbo, insulting a conference organizer, eating the most spicy peppers, or hugging a stranger for 6 hours.

I met a wide variety of people, from those that recognized my Highgroove shirt and had technical questions or were interested in knowing more about Highgroove Studios, to a guy from Hawaii working on a blog content generation startup, to a EE at Georgia Tech that is working on an open source hardware site: Open Hardware Hub.

So it's a conference: theres food and networking and all the usual things, but there weren't technical talks on anything and I have no notes or project ideas, but the takeaways for me are more valuable than that. These themes came up in most of the talks. Some are moreso reminders and reinforcements than they are something new, but all are pretty good:

  • Do what you love and stop doing things that make you unhappy - Every single person that spoke was successful at doing something they loved. There was a huge range of salaries (minimal to $500k+), time spent working (60h/week to 5h/week), family lives (single to married with kids), and priorities, but every speaker was successful and had left what an outsider might consider to be 'stable' or 'better' to do something they love. This does mean that you have to figure out somehow what makes you happy, and your criteria will be different from everyone else's.
  • Measure the cost to acquire a customer and the lifetime value of that customer - Especially for Software-as-a-service apps, the cost to get a new customer can be unexpectecly high ($250+ via Google Ads) and the lifetime value can be low. There is no reason to charge $1/month because anyone that will pay $1/month will pay $5/month. It's easy to get emotional about what's important, but when you're running a business these numbers matter a lot.
  • Not everything measureable is meaningful and not everything meaningful is measurable - The numbers matter but you can't measure everything. Give away t-shirts and don't worry about how to quantify it's impact on your bottom line. If some numbers don't feel right, get different perspectives on them until you understand what they actually mean. Do figure out what numbers are relevant to your business and make sure you're checking them as frequently as you need to be.
  • Embrace change - If something new comes along, or something you are doing isn't working right, or your priorities shift: change. Sell your business, change it's direction, quit your job, change your pricing (triple it!), start something new, etc.

I may or may not attend this one next year due to all the other cool things that happen throughout the year, but if you're interested in how to do a startup the right way or want some proof that these things can actually work out, LessConf might be for you.

Riding Bikes in 2011

Lots of time on 2 wheels, no broken bones, and lots of good times. 2011 has been a good year of riding, and after a crazy event this weekend, it seems like a good time to summarize a few things.

Velodrome

At the track, FM:Race held our own, even as people got injured, moved out of the country, and were just slacking. We were able to snag 2nd place team out of 28 teams, and our top A racer Brian Tester won Rider of the Year, getting more points than anyone else at the Dick Lane Velodrome in 2011. I finished in 19th place, and we had a few other people scattered through the top 30 placings.

This year, Jason Atwood and I raced in almost all of the "Madison" events and did pretty well. Winning one on April 20, and not getting lapped too many times in 7 others. Jason is out of state at grad school now, so we weren't able to do the last few.

Track racing has been a lot of fun, but it's also a huge time sink for the amount of 'saddle time' (4 hours every wednesday with 1 hour on the bike) and I got hurt due to actions of other people a bit too much for my taste. Mountain biking is what I enjoy doing the most, so track racing is going to take a back seat next year for other things.

Cyclocross

New for this year, I've done a handful of cyclocross races. Cyclocross bikes are basically road bikes with weird geometries, less effective brakes, and slightly knobbier tires used for riding around in grass and parking lots. Pretty ridiculous, but there was a great deal on a bike on the internet so I figured I would give it a shot. After a handful of races, I'm still not sure if it's fun, but I figure I should give something super crazy like Southern Cross a try before deciding if this bike is a keeper or not.

So far I'm 29th out of 170 for the season, and FM:Race is in 7th of 139 teams.

Roads

The vast majority of my road biking this year was the weekly FM:Race Training Ride, a terrible hill climbing ride that I try and add a few more hills to every year. This will continue in 2012 with a few small changes. I also did a few 100 mile rides, and I'll probably do a few more of those in 2012.

But then, sometime last week, Strava announced the Turkey Takeoff: Ride 250 miles in a 5-day period over Thanksgiving weekend. For some reason, I decided that this was a good idea to do and came up with a plan of attack. After my ~7 mile commute on Wednesday, I was running a little behind schedule. Thanksgiving morning, with perfect weather, I rode to Stone Mountain and did 2 laps. I've done this route more times than I can count and it get's pretty boring, but it was an easy way to grab 41 miles. Then it was off to Thanksgiving dinner.

Friday morning at 6:30am, full of turkey, I picked up Stafford and we headed to the start of the Silver Comet to head towards Anniston, AL. It was supposed to be 48F as the sun barely rose above the horizon, but ended up being 33F to start, and as we rolled westward we struggled to keep warm and stay positive. 2 hours in it finally passed 40F and we started to have a better time. We crossed the Georgia/Alabama border and started down the Chief Ladiga trail, and at Piedmont, AL we'd been riding for close to 5 hours. Based on some rough math, we figured that if we turned back, we could make it back to Smyrna, GA and the car by the time the sun went down.

Our original goal was to get all the way to Anniston, but that would have us riding for 2+ hours after sunset in the freezing cold which neither of us was really prepared for. I scarfed down a bag of Doritos from a gas station and we headed back. Once back in Georgia, the mile markers slowly ticked down, and we made it back as the sun was setting with 149 miles and 9 hours of riding time behind us. (more photos)

I was planning to take Saturday off and finish up the 250 miles on Sunday, but the forcast for Sunday called for rain so Jim, Bob, Federico, and I met up at 9:30 am on Saturday to squeeze in the last 50+ miles. I led the way, doing a combination of routes pretty familiar to me and making some random turns as well. It's touch to fit in 53 miles without a plan, but we pulled it of in one of the craziest intown routes that I've done.

250.9 miles in 4 days. Not bad! I was the 10th person to finish the Turkey Takeoff, and it looks like more people will be finishing throughout the day today.

Mountains

Per my plan, 2011 was full of mountain biking. I spent a week mountain biking in Colorado with Jason, and Jason and I did the entire Chainbuster Racing 6-hour 2-person race series. More details about that on the FM:Race blog: Chainbuster Series Finale.

Much more important than racing is just mountain biking with friends, and this year was pretty successful. I took my college friend Dave up to Stanley Gap for his first ride in the North Georgia mountains; Bob and I continued to boldly go and explore new places like Rock Hawk and Tanasi; I got CBQ and Mike from Highgroove on mountain bikes, quickly moving up from Atlanta Beach to Blankets Creek to Mulberry Gap; And it's looking like I will have done over 30 tuesday night "Dirty Mustache" mountain bike rides this year with anywhere from 4 to 15 people.

Rails 3.1 Assets on S3 with HTTPS

So your Rails app is deployed on Heroku which is pretty sweet and makes things easy. The Rails 3.1 asset pipeline is pretty awesome and packages your files up for you. You're using carrierwave to store Image attachments on Amazon S3, and everything is going great. Then, it's time to scale. Heroku isn't going to like serving all your assets all the time, CDNs are the right place to do that. Oh, and you need to be able to use SSL on the registration and login pages. Seems pretty easy, right?

There are plenty of very easily findable docs on each of those topics, but gluing them together took some figuring. First up, Make sure your Amazon S3 buckets are in the format 'media-example-com' and _NOT_ 'media.example.com'. Due to the way HTTPS works, if you try to access a https://media.example.com.s3.amazonaws.com/ URL you're going to get an invalid certificate warning. Doh! If you haven't done this, it's pretty annoying because there is no concept of 'move' or 'rename', so you'll have to copy files from the old bucket to the new one. Go ahead and start on this, it might take you a while.

Once that's done, it's pretty much just gems and configuration. Make sure you have these guys installed:

Then make a rake task that depends on 'assets:precompile' (which with asset_sync will take care of uploading your compiled assets to heroku):

That `assets:clean` part? That makes sure to wipe out your assets locally so that when you make changes to CSS/JS locally, they will show up in your browser as expected. That one took a few of us a while to figure out. ("WHY WONT MY CSS UPDATE!!!111!!!")

Then configure carrierwave, paying extra special attention to the fog_host URL, starting it with "//" which makes sure the resources will be loaded via http when the page is http, and https when the page is https:

Last up is configuring your asset_host for your production environment. All the docs suggest using a Proc here, but precompiling assets (needed for Rails 3.1 -> S3 on Heroku) doesn't have a 'request' to detect the hostname from so this completely blows up and you end up with no CSS or JS on your asset hosts. There are several related issues in the Rails issue tracker, but there's a super simple solution that works better than all of them:

And you're all set! `rake deploy` will compile your assets, upload them to your bucket on S3, and deploy your code to Heroku. When a visitor visits http://example.com/ they'll get all the assets (JS/CSS) and all your media (item images) from the HTTP version of your Amazon S3 buckets, and when they visit https://example.com/, they'll get the HTTPS version.

It should be super easy to plug in CloudFront if you need to scale up even further.

Mountain Biking in Colorado

Last week I spent 6 days mountain biking in Colorado with Jason. We stayed in 4 different hotels, drove a rental Dodge Charger somewhere in the neighborhood of 850 miles, and had a blast riding some of the best mountain bike trails in the country. I rode a rental Yeti ASR 5 Carbon and Jason was on a Yeti Big Top.

  • ~22 Hours of riding
  • 164.71 Miles
  • 29,154 ft of climbing
  • 11,991 ft max elevation
  • 55F low temperature, 104F high temperature

Monarch Crest, Salida

GPS Trace | Photos | Trail Info

Not a bad way to start the trip. We met up with Paul F and two of his friends to shuttle cars to the start and ride back to town. I had a few mechanical problems with my bike that we pretty quickly worked out, and we spent the day cruising at high altitude enjoying the scenery and getting aclimated. Paul and friends were pretty quick, but we didn't keep them waiting. Amica's Pizza afterwards in Salida was delicious.


Bear Creek + Methodist Mountain + Rainbow, Salida

GPS Trace | Photos | Trail Info

Day 2 was just Jason and I. We did a long fire road climb from Salida to 'Rainbow' which was pretty nice. We were feeling pretty good so instead of taking a right turn back to town where we planned to, we continued onward into the unknown, knowing that Rainbow connected up with our exit point from Monarch Crest. This turned into a 1.5 mile walk up a 1500ft hill which took quite some time and while the downhill on the other side was kindof nice, it definitely wasn't worth it. We both ran out of water, and once we got back down to the road the sky opened up on us and we took shelter under an awning on a random house on the side of the road to wait for the storm to pass. This was not a day either of us want to do again, but it was good to get the walking and dealing with the rain out of the way. Afterwards, we drove to Crested Butte and had a late dinner of wings and beer at Secret Stash which lived up to their reputation.


Trail 401, Crested Butte

GPS Trace | Photos | Trail Info

The 'superstar' trail as far as views go, 401 was goregous. We climbed up a gravel road to the start, passing by Emerald Lake and climbing over huge snowbanks. Once we crested the top of the mountain, we were treated to miles and miles of flowly downhill singletrack cut through fields of wildflowers. This was a 'short' 'easy' day so we didn't put in too many miles or work to hard, but words don't do the views justice so make sure to look at these photos. Massive numbers of flies at some points seemed particular attracted to getting stuck inside helmets, so there aren't quite as many photos as I would have liked because the only way to keep the flies off was to keep moving.


Edge Loop, Fruita

GPS Trace | Photos | Trail Info

Our IMBA Epic ride of the trip, Edge Loop is a long road climb tieing together fast flowly singletrack, super technical downhill jeep roads, a wash thats only dry and open 6 months out of the year, and great views. This was a hot one with a high of 104F, but due to super low humidity it felt a lot better than any summer mountain bike ride in the north Georgia mountains. We saw lots of rabbits and lizards, as well as gas wells and a pumping facility on the top of a mountain in the middle of nowhere. This isn't a ride that I'd do again 'just for fun' but it was definitely worth doing once.


18 Road, Fruita

GPS Trace | Photos | Trail Info

From the same trailhead as Edge Loop, the 18 Road network is a great set of super-fast XC runs. Some cut through desert plains, others down ridgelines with steep dropoffs on either side. We rode several loops, each time climbing slowly from the parking lot, picking a trail to decend, and loving the descent. A few of the trails had super steep downhill sections that gave me the same kind of exhilaration as the first drop on a roller coaster. Highly recommended, and what most people think of when mountain biking and Fruita are mentioned together.


Colorado Trail Kenosha to Breckenridge, Frisco

GPS Trace | Photos | Trail Info

To finish off the trip, we met up with Paul F again, this time in downtown Breckenridge, and shuttled cars to Kenosha Pass. This was never ending climbs followed by the most fun I've ever had going downhill on a mountain bike. Everything from smooth banked turns to super technical high-speed rock gardens interspersed between tight switchbacks. There's helmetcam video of this from Paul that should make it's way online sometime in the next week or two.


After 2009's Mountain Biking in Santa Fe, NM and 2010's Road Biking in Portland, OR, this was a pretty great 3rd annual bike trip. More time riding, more places, and minimal sunburn and flesh wounds. Next year will probably be another mountain bike trip, maybe British Columbia?