mechanical bee logo

about us

We make web applications for ourselves and for clients. or learn more.

Posts by Judy

Obj to three.js, getting your materials to show up

We were playing around with three.js and nearly died of despair when we could not get the materials to show up on our completely black but otherwise perfect looking model for no discernible reason. In hindsight, our problem with light and not having it seems obvious but at the time, it was really not obvious.

So if someone gives you an obj file with some jpgs that are supposed to be the textures for the model and asks you to render it in your browser with three.js, here’s what to do:

Organizing a large backbone and rails app, some thoughts

We recently started working on a new web app with backbone 0.5.3, rails 3.1, and couchdb. It’s not the still-raw-and-pulsing bleeding edge but it’s pretty new stuff. There are some nice examples of backbone apps, e.g. DocumentCloud, CloudApp, CloudEdit, Todo, etc., but conventions and best practices aren’t there yet in the way that they are for Rails.

Our app is larger than any of these examples so we thought we’d share how we’re currently organizing it, and handling routing, forms, and nested models.

Folders and Files

Our app files and directory structure are very similar...

Geek fun: building a lil' node.js app

We recently wrote a little service in Node.js and deployed it on Heroku’s Cedar stack. All it does is return UPS shipping rates when we do an http get with certain parameters. So instead of hitting UPS directly every time an item page loads, we hit the node app and it either pulls the rate out of Redis or asks UPS, meaning that shipping rates should come up a lot faster. We didn’t really need to spin up a Node app for this but hey, this is how we have fun :D.

It’s a pretty basic app but...

couch_record: a new CouchDB ORM for Ruby on Rails

We’ll write a more detailed post about it later but we’re excited to open this up now: couch_record, a new couchDB ORM for Ruby on Rails, using couchrest and based on our experiences with couchrest_model and, to a lesser extent, couchrest_rails.

Why do we need another CouchDB ORM?

When we were deciding which ORM to use, it seemed like couchrest_model had the most traction and most activity. But there were a number of aspects we were unhappy with (we wrote about one of them here).

Then recently we added New Relic and noticed some really...

Why we don't use the Heroku SendGrid addon

TL;DR: When you use Heroku’s SendGrid add-on, your account is a sub-user of the main Heroku account and doesn’t get manually provisioned or tiered based on goodness like solo SendGrid accounts. This means that the IP group your in is more likely to be populated with miscreants whose bad behavior decreases your own deliverability. So if you’re not a miscreant and don’t want to get lumped in with other miscreants, you should just sign up for a normal SendGrid account—the pricing/plans are the same or better anyways.

Using SendGrid via the Heroku addon is brain-dead easy

Using a...

How to auto reload gems that you're working on in Rails 3

We recently moved our CouchDB ORM code into its own Ruby gem because we’re thinking about making it open source. While working on the new ORM gem in the context of the Givmo Rails app, I wanted the the gem code to reload on every request like the rest of the code for the app. For a while I was making frequent changes and restarting the server every time got old pretty fast.

I eventually figured out how to do this, but it wasn’t super easy to find, so here’s the short, sweet version of what you’ll need to...

How to find your SendGrid login when using the Heroku addon

If you’re using the Heroku SendGrid addon, they’ll create account credentials for you. e.g. a username and password. Sometimes you want to either do some configuration or more frequently, log in to the SendGrid site to see stats and activity and stuff.

heroku config

and you’ll see a bunch of config vars. The ones you’re looking for are:

SENDGRID_USERNAME
SENDGRID_PASSWORD
SENDGRID_DOMAIN

Omniauth, openid, heroku, and https

We recently added the option to log in or sign up with Facebook, Twitter, or Google using the handy omniauth gem.

Facebook and Twitter went swimmingly. We had already been integrating with Facebook and Twitter so that people could tweet or post to Facebook to tell their friends about the items they’re giving away. Adding a sign up/log in pathway was just an extension of that functionality.

But we ran into a problem with Google and OpenID: they worked fine in development but kept failing with “invalid credentials” in production.

There are two main differences with our production environment:

...