Save RAM with mobile middleware

Wednesday, October 7, 2009

A while back I wrote an article on how to set up a mobile site with Django ../going-mobile. Currently I have a Slicehost account which includes 256MB of RAM. My resources are tight and I really dislike having another set of unnecessary Apache processes for a mobile site that, aside from different templates, is using the same code base. The solution is quite simple, write a middleware. The following code checks the incoming request for ’m' or ‘mobile’ in the domain name.

Continue reading →

What's next

Friday, December 12, 2008

Does it make sense to reinvent the wheel every time we start a new project? No. My work echoes my past and I stand by it. Some say, “that looks like Readernaut” or “that looks like Playground Blues” and I say yes, they are me. If it worked there it will work here. When a problem is solved I move on because each project has its fair amount of new problems and I’d rather spend time on new, more interesting problems.

Continue reading →

Message Queuing imports

Friday, September 5, 2008

Last week I ran into some problems dealing with large book imports on Readernaut. I tested the system for around 50-100 books but had no idea people would upload lists of 900+ books. This begged the question, how do you handle importing very large sets of data before the browser times out? Brief example User uploads a list of 1000 ISBNs to be imported into their library. Each book, if not already in the system, needs to be imported via another service like Amazon.

Continue reading →

Creating a basic API with Django

Monday, August 11, 2008

Creating a simple public API for your site is a lot easier than you may think with Django. You’re basically just creating another view and serving it as XML or JSON instead of HTML. What’s public? Decide what you want to be public. The best answer is the stuff you’re already displaying in your HTML templates. Then you need to create an entry in your url conf. url(r'^api/v1/(?P<username>[-\w]+)/notes/?$', 'readernaut.api.views.user_notes'), Create the view In the case for Readernaut I wanted to provide an XML feed for users notes.

Continue reading →

Capistrano rules

Saturday, May 17, 2008

I’ve grown tired of committing changes to my subversion repository, logging into my server, updating my live checkout, and restarting python processes. I finally decided to implement Capistrano and eliminate this repetition. Here are my repetitive set of commands: $ ssh playgroundblues.com $ cd ~/projects/playgroundblues $ svn up $ cd ~/www/playgroundblues.com/www $ touch django.fcgi Now, with the help of Capistrano, I just type: $ cap deploy You’ll first need to install Capistrano which is as simple as gem install -y capistrano.

Continue reading →

Aspen Simulator

Tuesday, May 13, 2008

As much as I’d like to blog about my trip to Austin and SXSW last week I’m just too excited over the iPhone SDK goodies that dropped last Thursday. You may be asking yourself, “he’s a web guy, why does he care?” Well, there happens to be a beautiful gem tucked away called the Aspen Simulator. This is a complete pixel and functionally perfect replica of the iPhone and it’s fantastic for testing web apps.

Continue reading →

Ah-ha Event Delegation

Monday, May 5, 2008

Wrapping my head around things like OOP took months. It’s not because I’m an idiot (I don’t think) - it’s just because I needed all the explanations to marinate before having an ah-ha! moment. I had an ah-ha today, with regards to Event Delegation. I’ve never seemed to completely understand events, yet I use them all the time. They’re an essential aspect of Actionscript and Javascript and there are two basic ways of capturing events, Event Handling and Event Delegation.

Continue reading →

Gadget fast

Friday, April 18, 2008

My iPhone and laptop will be unplugged starting Friday evening for two days. I’ve let the fog of distractions generated by these two devices grow too thick so for the next few days they’ll be turned off. It doesn’t stop there. The following week Twitter, Flickr, an my feed reader will be muted. I have nothing against these services, but it’s time to step back and take the pulse of things around me and see if I’m missing something.

Continue reading →

Going mobile

Monday, February 18, 2008

Over the weekend, I decided to whip up a mobile (iPhone) version of Playground Blues. I walked into Broadway Cafe around 3pm on Saturday, and by 5:30, I had m.playgroundblues.com. Here’s how it went down. Step 1 Since I’m still using Dreamhost and FastCGI, I created my .htaccess file along with my dispatch.fcgi file for my new sub-domain as usual. Made one little change to my dispatch file: instead of having DJANGO_SETTINGS_MODULE pointing to playgroundblues.

Continue reading →

iPhone bookmark iconage

Tuesday, January 15, 2008

If you’re wondering how to control the icon that gets generated for your webpage with the new 1.1.3 iPhone release, look no further than Apple’s iPhone Dev Center. Apple has added a section called “Create a WebClip Bookmark Icon” and it calls for a 57x57 pixel icon. After some testing today I’ve concluded this recommended sizing results in a fuzzy icon, largely due to the iPhone being a 163 ppi display.

Continue reading →