Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

1) Get your friends to stand in stupid poses 2) Crop and resize as squares 3) Instant Internet Birthday Card!

branch: master
README.textile

BirthdayCardy

BirthdayCardy lets you make a simple rotating-image webpage using silly pictures of your friends to spell a message. Um that might not make any sense but if you go look at http://birthdaycardy.heroku.com you can see what I mean.

1) Take multiple photos of your friends in silly YMCA poses spelling out letters in a message. This will take much beer.
2) Crop and resize them to squares. This will take much patience.
3) Add them to the right directories and deploy. This will take almost no time at all.
4) Email to your friends!!!

Detailed instructions

Photo Shoot

You need the letters “A B D H I P R T Y” to spell “Happy Birthday”, but you can use any old greeting (see settings.yml). Since I know you’d rather code than spell, run your greeting through

  ruby -e 'puts "happy birthday".gsub(/[^\w]/,"").chars.to_a.uniq.sort.join(" ")'

to list the letters you need.

Get creative:

Crop your photos

Crop and center the photos to each have the same aspect ratio to more or less fill the frame.

Create a directory outside the git repo called raw_photos or whatever, and make subdirectories for each letter. For example,

  $ ls -d raw_photos/*
  raw_photos/a  raw_photos/b  raw_photos/d
  raw_photos/h  raw_photos/i  raw_photos/p
  raw_photos/r  raw_photos/t  raw_photos/y

Copy each photo to its appropriate folder. You can name them anything you want.

Resize the photos

You can resize them all from the commandline with ImageMagick. Let’s say your photos are in raw_photos and you’d like to resize them to 180 pixels:

   $ cd raw_photos
   $ mkdir path/to/project/public/images/180px
   $ for foo in */*.jpg ; do echo $foo ; convert -resize 180x180 $foo path/to/project/public/images/180px/$foo ; done

Edit config/settings.yml

Change the settings for your project:

  • :greeting sets the phrase that is displayed. Each word forms a new row.
  • :random_img_path sets the path within the public/ directory to the letters’ folders
  • If you set :page_refresh_rate it will insert a meta refresh tag in the page header to reload every that number of seconds.
  • Change :session_secret to something random, and set the domain and repo appropriately.

You should remove the config/settings.yml file from your repo and copy it over on deploy.

Credits

  • Thanks to Jo for resizing everything.
  • The frontend app is based on Monk / Cartilage, a skeleton for building Sinatra apps.
  • Happy Birthday Becky

Setup

I recommend heroku — it’s free and it takes like seconds to deploy. If you’d like, however, there are capistrano scripts for deployment and god scripts for monitoring the server

Install nginx, unicorn and the other requisite gems (see the .gems file). Customize the files in config/production and copy them to their corresponding places on the server. Then do a deploy:

    # initial deploy
    cap deploy:setup                                                                     
    cap deploy:cold
    # Copy over the server's settings.yml for inclusion in each deploy
    scp  config/settings.yml remotehost.com:/var/www/birthdaycardy/shared/config/settings.yml
Something went wrong with that request. Please try again.