• HOW TO: Get your web browser gestures back in OS X Lion

    If you’re like me and have a magic mouse and use the internet much, you’ve probably gotten used to using the two-finger swipe to navigate forward and back in your history in Firefox and Chrome instead of using the back button. Apple has changed the default behavior in OS X Lion to swipe between fullscreen apps. Which means suddenly when you’re trying to go back to the previous page, you end up looking at your dashboard or something dumb.

    To get your two-finger swipe navigation back, just go into the Mouse preferences and over to the More Gestures section. Change the first option (Swipe between pages) to use two fingers.

    This will disable the full-screen swiping and get you back up and running. Doing the same thing on your laptop should work as well, except you’ll pick three-finger swiping instead of two.

    Enjoy.


  • Four Steps to Turbocharge Rails + AJAX Development with Nginx and Foreman

    If you’re developing a chatty AJAX app on Rails and using a single mongrel to run it on your workstation, you probably are a bit annoyed with delays waiting for requests to be fulfilled one-at-a-time. So, here I’ll walk through the steps to run your own “cluster” on your OS X workstation using Foreman and Nginx.

    In the course of building the frontend application for Earbits, I’ve been constantly annoyed with the responsiveness of my local development server. As a pretty complex AJAX application, there are lots of little (and some bigger) calls to the Rails backend APIs to do lots of potentially slow things. This means that there are lots of calls that are originating in the browser and being served by one mongrel, so the server ends up handling requests too slowly. Which leads to me being frustrated. Which leads to me finding a nice solution to the problem.

    (more…)


  • Whirlfood – social suggestions for food & nightlife [beta]

    Well, this is the site that I’ve been working on in my learning Ruby on Rails series. It’s called Whirlfood (pending a better name) and it is going to be a social suggestion site that helps you pick places to eat and where to go out with friends.

    But while we’re working on the algorithm, it just does some neato analytics on your data. We’ll be adding more analytics once we get the friend import stuff working – we we can analyze how you interact with your friends and look for trends. Then we’ll really start to tackle the suggestion engine. We have what we think are some pretty cool ideas for that part.

    Stats Dashboard

    Fullscreen Map View

    This is just a quickie screenshot set of what the stats look like for me (and I’ve only been using Foursquare for 2 weeks while building this app). If you want to sign up and play with it, let me know and I’ll get you the link to the beta site!


  • Upgrading your Authlogic Gem for Rails3

    If you’re using Authlogic in Rails3 (or if you’re upgrading your existing app from 2.3.8 to Rails3) you really need to be using the rails3 branch of the Authlogic gem. If you’re using Bundler, this is super-easy because you just need to update your Gemfile.

    In your Gemfile, update the authlogic line to be:

    gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
    

    Now you should run $ bundle install to grab the new gem. Then, there are just a few more deprecated things in Rails3 that you’ll need to change in your upgraded app. I’ll try to enumerate here from memory, so please forgive me if I forget something.

    (more…)


  • InvalidAuthenticityToken on Logout when using Authlogic

    This one took me a while to debug. When upgrading my existing application to Rails 3 almost everything was working fine except whenever I would click the Logout link I would get an error because Rails couldn’t verify that the UserSessionsController#destroy request was valid from my app.

    This is the error message shown:
    ActionController::InvalidAuthenticityToken in User sessionsController#destroy

    actionpack (3.0.0) lib/action_controller/metal/ request_forgery_protection.rb:96:in `verify_authenticity_token'

    And the solution is simple, you just need to add the new csrf_meta_tag helper to your generated page (probably in the /views/layouts/application.html.erb file).

    (more…)


  • Coming Soon: Earbits Radio iPhone App

    Earbits is a new 24×7 commercial-free, subscription-free free internet radio service that just launched last Friday. Once it’s fully baked, it’s going to have some really cool artist discovery tools and great utilities for bands who want to get their music heard.

    I’ve been involved in the minor capacity of building the actual player used on the website and for embedded players on partner websites. It’s been a nice refresher of using my javascript skills. And now, I’m expanding my role into building the first mobile Earbits app for the iPhone. Since I’ve been trying to learn Ruby on Rails over the past week or so, I decided that I might as well also try and learn Objective-C and that whole mess too.

    Keeps life interesting. But here’s the teaser shot taken right after the first time I actually deployed the radio app to my iPhone.

    Hope to have a beta version done in a week or so, depending on API availability, and get it into the App Store sometime in September.


  • A User Friend Relationship Model in Rails

    In building my first Ruby on Rails app, I needed to create a facebook / social-networking style friend relationship between users. The simple requirements were that it the friendship should require approval (e.g. a friend request followed by an accept or ignore) and it should be lightweight (not using two records for a single relationship).

    This method and code is inspired by two blog posts, which got me started but neither of which really fulfilled my complete requirement. The first used two records per friendship and the second was a twitter-style friend/follower without the approval process.

    So, here I break down my Friendship model which hopefully you will find useful and/or insightful as a complete solution or a starting point for your own implementation.

    (more…)


  • Annoying Zune Behavior – Ordering “By Rating”

    I want to sort my music “By Rating” in the Zune media player software. This is natural. But what’s wrong with this track order here?

    Yeah, the software puts the songs which have ratings above the songs without ratings, which in itself isn’t a bad idea. But this means that if you just start playing down the list of your favorite songs right after your favorite songs it’s going to play the songs you hate the most. Then it continues with the rest of your library in alphabetical order.

    Come on, Microsoft… you can do better. Just put the most hated tracks at the bottom of the playlist when I sort by rating.


  • Rails Deployment: Engine Yard or Heroku?

    As I’m thinking about beta launching my first Rails app, I need to decide how to do the deploy.  Heroku and Engine Yard stand out as the most popular hosts, from what I see. Heroku also has a free option, which appeals to me.  Is one much better than the other?

    Long-term, I will probably host the app myself at my colo, but to keep things simple at first I don’t want to learn the intricacies of Rails hosting right now…


  • Chart: A Very Productive Evening

    This is what learning a new language looks like: 50% time writing code, 25% time using chrome for research, and 10% time in firefox running and debugging the app.

    Clipped from RescueTime which is a fantastic freemium app that tracks everything you do on all of your computers and then does analysis of how you spend your time.

    Pretty cool, huh?


FRESH / LATEST POSTS

FRESH / Twitter Updates