Apple markets the iPhone as a true Internet device comparable to its desktop alternatives. One of its killer features is a real web browser. No longer are we stuck with mangled mobile versions with a quarter of the features. No longer do we need our laptops to use the web the way we are accustom to. No longer are web designers required to make mobile versions to support a cell phone.
So what did web designers start doing to welcome this new freedom for iPhone? They started making mangled iPhone versions with half the features of course. Isn’t this why nobody used the mobile web before the iPhone? Isn’t the reason we love the iPhone because it gave us a real browser? What gives?
Every time I use Facebook on my iPhone I have to scroll down to the bottom and click the link to view the standard site, otherwise I can’t see events and invites. Problem is most time I use Facebook on my iPhone is because I need an address to an event. Same goes for Twitter, Google, and a ton of other sites.
If you want an iPhone specific interface for your site, write an iPhone App. But if I’m using Safari, please just give me what I want– a full functioning site that I’m familiar with and has what I am expecting.
Tags:
iPhone4 Comments
This week I was lucky enough to spend two days at the Merb Sprint. At the sprint I spent some time testing the install and setup process for the Merb Stack and merb_auth (the merb authentication gem). Dan Neighman (aka hassox) spent some time with me going over the merb_auth process and this is my attempt to pass the information on.
This walkthrough will take you through the steps to get a Merb app up and running with a protected resource. It assumes you are running Merb 0.9.9 or greater with the Merb Stack (merb-core, merb-more, and datamapper).
Lets start at the beginning and create an app
$ merb-gen app authentication_app
$ cd authentication_app
By default merb-gen app will create a user model for you in app/models/user.rb. The model is there, but we still need to create the table in the database and add a user to authenticate with. Lets do that now.
$ rake db:auto_migrate
To create our first user we can drop into Merb’s irb console mode with merb -i. Like Rails’ script/console, merb -i gives you access to your models and other classes.
$ merb -i
u = User.new
u.login = 'joe'
u.password = u.password_confirmation = 'password'
u.save
exit
In order to test authentication we need something to protect. Any controller would work, but lets create a resource.
$ merb-gen resource secret
We will need to add a route to the resource also
# router.rb
Merb::Router.prepare do
resources :secrets
...
end
To protect a controller with authentication we can use the before filter ensure_authenticated
# app/controllers/secrets.rb
class Secrets < Application
before :ensure_authenticated
...
end
Everything should now be setup in our app. Lets give it a run through.
First you need to start you merb server. Make sure you are in your merb app’s root directory.
$ merb
Now you can test access to your resource is denied before authentication.
http://localhost:4000/secrets
Login in and try to access the recourse again.
http://localhost:4000/login
http://localhost:4000/secrets
You should now be able to access the resource. Awesome.
Tags:
Merb,
merbcamp,
merb_auth12 Comments
Today I stumbled upon the first program I ever wrote. It’s an interesting story looking back twenty years later.
When I was somewhere between 8-10 years old my uncle gave my family our first computer, a Coleco Adam. Along with the computer we were given the now classic book BASIC Computer Games. No one in my family new anything about compilers, programming, or computers in general, but we were excited about the idea of creating something out of nothing so decided to give one of these programs a go.
We decided on Bunny and began to slowly peck out the source code into the text editor. We saved the file, exited the editor, and then stared blankly at the screen as we realized we didn’t know what to do next. Interpreters and compilers were obviously never discussed and after our futile attempts of running our program failed, I decided to take a different approach.
What was I trying to accomplish? What were the outcomes I needed? The answer was simple- an ASCII image of a bunny. So that’s what I created, and ASCII image of a bunny. For the rest of the afternoon I typed out the bunny by hand and by using brute force I eventually accomplished the goal.
This retrospective reminds me that when things “just aren’t working”, sometimes I need to take a step back and reevaluate my methods. I may have an Occam’s razor type revelation that could satisfy requirements without significant compromises.
Keep it old school and tell the world your first programming experience in a comment below.
Tags:
Agile,
personal,
retrospective3 Comments