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!!!
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:
- Make your friends stand in YMCA poses. More salacious the pose = more better the pose
- Use Light Writing
- Find letters in found objects and in your neighborhood
Crop and center the photos to each hanve 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.
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
Change the settings for your project:
:greetingsets the phrase that is displayed. Each word forms a new row.:random_img_pathsets the path within thepublic/directory to the letters’ folders- If you set :page_refresh_rate it will insert a
meta refreshtag in the page header to reload every that number of seconds. - Change
:session_secretto 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.
- Thanks to Jo for resizing everything.
- The frontend app is based on Monk / Cartilage, a skeleton for building Sinatra apps.
- Happy Birthday Becky
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