Posted
April 21st, 2009
in
Programming
/
Tags: Magento, PHP
Magento, an open-source PHP ecommerce solution, has a very comprehensive feature list. However, its built-in CMS doesn’t support hierarchical pages. You can fake it, though.
Read the rest of this entry »
Posted
March 18th, 2009
in
Programming
/
Tags: iPhone, Objective-C, Programming
I finally got around to downloading the iPhone SDK to see what I can do with it. Since I’ve dabbled in game development back when I worked with Flash and Director, I figured I’d see what I can do with the iPhone. I wanted to start with a framework and I looked at Torque and Unity. Though inexpensive by game engine standards, during a recessionary time of cost cutting, it’s hard to validate a nearly $1000 purchase, especially if you don’t know yet if that investment would pay off. So I finally settled on the cocos2d-iphone framework which is based on the cocos2d framework for Python. There is little to no documentation, so be prepared to read source code. Monocle Studio’s whitepaper will definitely help you bootstrap your project. In the spirit of that paper, I thought I’d share my translation of the cocos2d “Hello, World” example adapted for the cocos2d-iphone framework.
Read the rest of this entry »
Posted
March 10th, 2009
in
Programming
/
Tags: Drupal, PHP
Drupal has a Taxonomy module for categorizing content. The module can generate a select box based on the defined taxonomy. However, it does not support option groups. I figured I’d share my modification for those who’d like to do the same. It was based on code from a Drupal forum post which I think was based on Drupal 5, not 6.
Read the rest of this entry »
Posted
March 2nd, 2009
in
Programming
/
Tags: Ruby on Rails
So I had to move an application that I’m developing from a MediaTemple (dv) Dedicated-Virtual to a Ruby on Rails GridContainer running on a MediaTemple (gs) Grid-Service. Most of the tutorials I found that covered installing a Rails app on a GridContainer were somewhat dated. Things that were different than expected include:
- Rails, a few precompiled gems (like RMagick), and a test app are automatically installed for you. Most of the tutorials walk you through installing Rails and the skeleton app from SSH. That’s no longer necessary.
- For Capistrano, you need to set the
syspath
option (“System” in the control panel) to /home/[xxxxx]/containers/rails/[app_path]/current
where [xxxxx] is your GridContainer number and [app_path] is where you want your app located. I kept the app path and app name the same.
- You can’t edit application options from the web control panel. You have to do this from a SSH session using
mtr set_option
. You may need to do this to change the syspath
or to set the environment
. For example, to set the environment to “staging” you use the following command: mtr set_option [app_name] environment=staging
.
- If you change the
syspath
make sure to update the symbolic link to the app’s public folder under your app’s domain, otherwise you’ll get an app not found error. In other words, ~/domains/example.com/html
should point to /home/[xxxxx]/containers/rails/[app_path]/current/public
.
- When an application fails to start, you get no feedback about the cause. Check log/mongrel.log for details as to why your application fails to start.
- After changing the
syspath
, the app may not restart. You may get an Address already in use - bind(2) (Errno::EADDRINUSE)
. To resolve this, I ended up having to reboot the container.
- For some reason,
rake gems:install
didn’t work. I had to manually install each gem.
I definitely had a lot more control over the installation when I had the application running on the (dv) using Passenger Phusion, especially having the ability to compile software. However, the GridContainer runs a lot faster.