Mobilize Your Rails Application with Mobile Fu 0

Posted by brendan
on Wednesday, August 06
I originally posted this article on Intridea's Blog at http://www.intridea.com/2008/7/21/mobilize-your-rails-application-with-mobile-fu. I thought I'd go ahead and post it here as well. No worries, if you've read it before, it's the exact same thing.

Let's face it, iPhone interfaces are awesome, but they can only cater to a fraction of the mobile market. What are you to do if you want to satisfy the rest of the mobile world? Mobile Fu helps to make this job much easier by automatically detecting mobile devices that access your Rails application. People can access your site from a Palm, Blackberry, iPhone, Nokia, etc. and it will automatically adjust the format of the request from :html to :mobile.

Learn Mobile Fu

First off, just install the Mobile Fu plugin into your Rails application.
script/plugin install git://github.com/brendanlim/mobile-fu.git 

Start by adding this one line to your ApplicationController.
class ApplicationController < ActionController::Base
  has_mobile_fu
end

Once this is in place, any request that comes from a mobile device will be be set as :mobile format. It is up to you to determine how you want to handle these requests by creating the .mobile.erb versions of your views that are to be requested. Also, I recommend that you setup a before_filter that will redirect to a specific page depending on whether or not it is a mobile request. How can you check this?
is_mobile_device? # => Returns true or false depending on the device

You can also determine which format is currently set in by calling the method below.
is_mobile_view? # => Returns true or false depending on current req. format

If you want the ability to allow a user to switch between ‘mobile’ and ‘standard’ format (:html), you can just adjust the mobile_view session variable in a custom controller action.
session[:mobile_view] # => Set to true if request format is :mobile and false
                      # if set to :html

What About Custom Mobile Styling?

Different devices need different styling. Don’t worry though, we’ve got this baked in to Mobile Fu (thanks to Intridea's own Michael Bleigh, who created Browserized Styles for letting me modify his code). If you are including a css or sass file via stylesheet_link_tag, all you have to do is add _device to the name of one of your files to override your styling for a certain device. The stylesheet that is loaded is dependant on which device is making the request.

Supported stylesheet override device extensions at the moment are: blackberry, iphone, mobileexplorer, nokia, palm
e.g., Accessing a page from a Blackberry.

<%= stylesheet_link_tag 'mobile.css' %>  

Ends up loading mobile.css, and mobile_blackberry.css if the file exists.

Feature Requests

You can check out Mobile Fu's very own project page at Acts As Community. If you have any problems or would like me to add a certain feature, please create a ticket at http://blim.lighthouseapp.com/projects/14490-mobile-fu/. Also, feel free to fork Mobile Fu and make any enhancements you please from its GitHub location at: http://github.com/brendanlim/mobile-fu/tree/master

SMS Fu Gets Rails 2.1 Compatibility

Posted by brendan
on Thursday, June 19
I've received a couple of e-mails regarding SMS Fu and its incompatibility with Rails 2.1 lately. I've been quite busy lately and haven't had much time to check out the situation, but fret no more. I've updated SMS Fu to be fully compatible with the newest version of Rails. Please visit the SMS Fu project page at ActsAsCommunity if you have any questions or comments or you could always check it out at GitHub. Also, if you're on 2.1, you can install SMS Fu directly from GitHub using the line below -- sexy.
script/plugin install git://github.com/brendanlim/sms-fu.git

Oh Yeah, Here's My Late RailsConf 2008 Post

Posted by brendan
on Wednesday, June 18
Well, it's only taken me about half of a month to write my post RailsConf 2008, and don't worry, this is not going to be much of a post either. I had a great time at my first RailsConf, especially since I was with my buddies/co-workers from Intridea (read Intridea's full RailsConf 2008 recap). It was great being in the presence of so many big name individuals from the Rails and Ruby community.


It was also my first time in Portland, Oregon and one word of advice is not to smoke in public -- the homeless there can smell you and will hunt you down for a cigarette, which I didn't have many of since I am too nice and gave most of them away. Overall, I had a great time, learned some great things from the sessions and met many people.


SMS Fu Only Available Through GitHub

Posted by brendan
on Friday, April 25
After being spoiled with Git, I, along with many other developers, are dropping their subversion support in favor for git. From now on, you can grab the latest version of SMS Fu directly from GitHub. Feel free to fork it and contribute some changes here.

Also, unless you're on Edge rails you can install SMS Fu by doing the following below:
git clone git://github.com/brendanlim/sms-fu.git vendor/plugins/sms_fu

Intridea Multitasks The Web 2.0 Way

Posted by brendan
on Friday, April 25
Just thought I'd echo an article about Intridea that was recently posted in the Washington Post TechBlog. You can checkout the article by going here.
Intridea has borrowed some ideas from the big guys, such as Google's 20 percent time, which allows workers to spend a day a week dreaming up new products as side projects. It's also took an innovative approach to recruiting, reading the blogs of developers to find out what they are doing. "We want to get the sharpest guys and give them infinite flexibility," Upender said. "We find the smartest guys. They already proved themselves by launching some ideas, they're already blogging about some technology that interests them, ... and within a day they're being productive. They're checking in code. They're building new functionality."

SMS Fu - Now with International Support

Posted by brendan
on Monday, March 31
I've received quite a few requests to add some International carrier support to SMS Fu, so I've decided to go ahead and do just that. On top of adding some International carriers, I've also externalized the carrier list into sms_fu.yml, so that anybody can simply add their own custom carriers. You can grab the latest through git or svn.

Now, there's over 30 different carriers that are supported right out of the box. Here is the new complete list of supported carriers: Alltel, Ameritech, AT&T, BellSouth Mobility, BlueSkyFrog, Boost Mobile, Cellular South, Fido, Metro PCS, PSC Wireless, Qwest, Southern Link, Sprint, Suncom, T-Mobile (US/UK/Germany), Virgin Mobile, Verizon Wireless, Vodafone (UK,Italy,Japan).

View the updated README and view the super simple installation instructions here or here.

Grab the latest through svn:
script/plugin install http://sms-fu.googlecode.com/svn/trunk/sms_fu
Be cool and grab the latest through GitHub:
git clone git://github.com/brendanlim/sms-fu.git vendor/plugins/sms_fu

New Penryn Macbook Pro Arrived

Posted by brendan
on Wednesday, March 05
It looks like it's about time to put my old Macbook Pro to sleep. I received my new 2.4GHz/2GB Penryn based Macbook Pro this morning and I'm loving it. My old Macbook Pro was still sufficient for day to day use, but the uneven CCFL backlighting and RAM limitation were enough to persuade me to make the switch. I've already got a 4GB set of Crucial memory in the mail that should arrive tomorrow. Also, the LED backlighting is glorious and the 200GB of space should be a good amount for me. My old machine had a matte display, and that was one of the toughest choices that I had to make. I ended up choosing glossy, we'll see how that works out. Overall, all of the points I mentioned, plus the added fun of multitouch, makes me a very happy consumer.

New Penryn MacBook Pro

Send Text Messages From Rails with SMS Fu 16

Posted by brendan
on Thursday, February 28
This plugin has been sitting dormant for a while and I haven't had a chance to really write about it since I've been so busy lately. Basically what this is, is just a quick Rails plugin that allows you to send an SMS from your application. This does not require any kind of "gateway" or third-party service to get the job done. The plugin takes in a phone number, the carrier, and a message. From this information, it will format an e-mail correctly that will actually end up being sent to that phone in the form of a text message. How easy is it to use? Very.

You can grab the latest from GitHub.
git clone git://github.com/brendanlim/sms-fu.git vendor/plugins/sms_fu

Supported Carriers: Sorry, International carriers aren't supported at the moment. Alltel, Ameritech, AT&T, BellSouth Mobility, BlueSkyFrog, Boost Mobile, Cellular South, Fido, Metro PCS, PSC Wireless, Qwest, Southern Link, Sprint, Suncom, T-Mobile (US/UK/Germany), Virgin Mobile, Verizon Wireless, Vodafone (UK,Italy,Japan).

Add this one include line to one of your controllers.
      class ExampleController < ApplicationController
        include SMSFu
      end
After this, just edit /config/sms_fu.yml with your custom reply-to address.

The three required parameters are the phone number, carrier, and the message itself. You can find the correct carrier codes in sms_fu.yml.

      deliver_sms("5558675309","AT&T","your message here")

You can set the maximum length of the SMS message, which is not set by default. Most phones can only accept 128 characters, and each phone can handle these messages differently. To set the limit, just pass it in as an option when delivering an SMS.

      deliver_sms("5558675309","AT&T","your message here", :limit => 200)

If you want to roll your own mailer and just want to use SMS Fu to retrieve the formatted address of the recipient, you can do so by doing the following below.
      get_sms_address("5558675309","AT&T")

Hope you all enjoy, and please send me some feedback on any new features you'd like added.

New Apple 30" Cinema Display 2

Posted by brendan
on Sunday, February 17
I've been putting this off for a while, mainly because of the fact that it costs quite a bit of money. Well, I ended up getting one today and I do not regret it one bit, especially since Edel knocked off about $800 of it for me. Since I do work from home, it will be used quite a bit and with the amount of windows I typically have open, I'll be using it to the fullest of it's potential, well, at least the resolution. There is indeed a correlation between screen size and productivity! Oh, and I must say that I find it quite easy on the eyes!

Apple 30" Cinema Display - Closer

Firebug for Firefox 3 Beta, Finally!

Posted by brendan
on Wednesday, February 13
I was on Lifehacker today and found out that Firefox 3 Beta was released. I've tried a couple of the alpha releases, and I can say that I love the new features, enhanced memory usage, and how it just looks right on a Mac now.

The one thing I didn't like though, was that the Firebug I had installed, wasn't compatible with the Firefox 3. I can't really do my job "efficiently" without Firebug -- since I've become so accustomed to how it just makes my life much easier. Well, after digging around, I finally found a version of Firebug (1.1 beta) that works just fine with the new beta release of Firefox and I thought that I'd help spread the news around.

Go and download Firebug 1.1 beta and be happy.

TinyURL Rails Plugin - ActsAsTinyURL

Posted by brendan
on Saturday, January 19
Today, I felt like making a quick little Rails plugin and what better & easier than one that ties into TinyURL's tinyurl.com URL shortening services. The service works by you submitting them a URL, and they return to you a nice shortened version that redirects to the URL that you originally submitted. I've had to integrate their services into a web application before, but I didn't see a plugin made for this, so I thought I'd whip one up called ActsAsTinyURL because it was quick and easy.

script/plugin install http://acts-as-tiny-url.googlecode.com/svn/trunk/acts_as_tiny_url

How do you use it? It's extremely simple. Once installed, open up a controller you want to use it in and put 'include ActsAsTinyURL' right underneath the class declaration.

class ApplicationController < ActionController::Base
  include ActsAsTinyURL
end

Once you've got this in place, you can start doing some quick magic.
tiny_url("http://brendanlim.com")  # => http://tinyurl.com/3274fk

Expect updates within the next few days when I get some added time in my schedule.

project = done if rails?

Posted by brendan
on Friday, January 11
I have to thank my good friend Theo for this awesome shirt that he got me. Theo told me that he had a gift that he got me that he claimed was "perfect". I guess he understands my love for everything ruby. Now, all I need is the acts_as_sexy shirt to add to my geek atire.


What Engineering is All About

Posted by brendan
on Monday, November 19
Dilbert, you're spot on. I can't say that this exactly resembles my day to day work experience, but I'd be lying if I didn't say that it was close (except assigning any blame).


Yappd's Articles From Beginning to End

Posted by brendan
on Sunday, November 18
When we (Brent, Andrew, and myself), started Yappd in August, we didn't think it'd gain as much attention as it did. Not all of it was good attention, but we were all just happy to know that people noticed what we built. I never really spoke out about Yappd that much, but I must say that it is something that I am really proud of and I am amazed at how hard we worked to get it up and running within two weeks. After the acquisition of Yappd's "assets" and it's closing this month, I thought it'd be good to consolidate a list of articles that mentioned Yappd. Below is a list of all of the articles from popular publications and web blogs. I might have missed some, and if I did let me know and I'll make sure to add it in. Hopefully I'll be able to add another list like this for something else, but I don't think I'm allowed to do that anytime soon.


TechCrunch
Yappd Launches, Calls Itself "Twitter With Pictures"
Yappd Didn't Last Long. Deadpool

PC Magazine
Get The Word out Fast! Yappd

Mashable
Yappd is a Visual Twitter Clone
Visual Twitter Clone Yappd Acquired; By Who?

Center Networks
Interview with Yappd Co-Founder, Brendan Lim
Yappd Launches Developer API and Web Photo Uploads
Yappd Acquired

Extreme Tech
Twitter, Jaiku, Pownce, Yappd - Four Microblogging Sites Reviewed

Download Squad
Another Twitter Launches, This Time It's Called Yappd

Killer Startups
Yappd - Twitter With Picture Messaging

Finally Running Mephisto on Slicehost

Posted by brendan
on Saturday, November 17
Finally got my slice from SliceHost and had some trouble getting Mephisto installed. After about a good two hours of digging through possible paths towards Mephisto nirvana, I finally succeeded. I'm back and I'm damn sure that nobody missed me, nor noticed. If you feel like grabbing yourself a slice, head on over to SliceHost and add me as your referrer (brendangl@gmail.com). Why? Just because you're nice like that. Sliced servers are the best thing since sliced bread.