adrenaline rush: biking down webster tube

i remember trying to get from san francisco to alameda, and the scariest moment in my life was biking down webster tube.  it's this underground, very narrow, dimly lit, 2 lane/no shoulder tunnel that connects alameda to berkeley.

i was literally screaming the entire stretch, every time a car passed me i swore i was going to be run over (the tunnel makes the cars sound even louder).  i had no helmet, no reflectors, nada.

here's the starting point:
View Larger Map

and here's the end point:
View Larger Map

if you want an adrenaline rush, try that one.  especially if you have any sense of claustrophobia.

easy way to do hex -> uiColor in xcode

saw a cool discussion on apple's support forums.  one of tedious things is the way UIColor works.  you can just insert your RGB values and append /255.0 to let xcode run the calculations for you:




yourLabel = [[[UILabel alloc] initWithFrame:CGRectMake(260.0, 250.0, 175.0, 25.0)] autorelease];
// orange
yourLabel.textColor = [UIColor colorWithRed:255.0/255.0 green:127.0/255.0 blue:1.0/255.0 alpha:1.0];


using ruby sockets to find ip addresses

i'm surprised it's this verbose to find your ip address in ruby, but here it is:

require 'socket'

def local_ip
  orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily

  UDPSocket.open do |s|
    s.connect '64.233.187.99', 1
    s.addr.last
  end
ensure
  Socket.do_not_reverse_lookup = orig
end

# irb:0> local_ip


# => "192.168.0.127"

also, try this one out too if you're using a specific port:

def index
@local_ip = local_ip
    if @local_ip == "192.168.1.12"
      @local_ip = "localhost:3000"
    end
end

 

edit: as it turns out, you will almost never need to do this.

having code signing problems when submitting to the app store?

this one frustrated me tonight, and it's probably the biggest time sink as someone new to the submission process.

from the iphone developer site, go to "provisioning" and click the "distribution" tab.  you'll need to download and set your code signing from xcode to your distribution provision profile, not the developer one.  a very obvious mistake, but one that could make you wonder what's going on.

domains and apps should be easier

would be cool if someone could automate all of these tasks associated with simple things like buying a domain or setting up a new app:

1) you update nameservers and mx records (both for google verification and for apps hosting such as email)

2) you have to go through godaddy's used car salesman method of registration, which consists of clicking "no thanks" 20+ times

3) you have to setup virtual hosts

4) you have to create directories and install whatever framework you're using like ruby on rails

5) you have to setup phusion or apache or whatever

6) you have to add database tables, add users, change permissions, set passwords

7) you have to tell other people involved in the project all of this as it happens

8) update dns settings with your vps

9) create a git repository, set permissions, add collaboraters, setup repos on your localhost

10) if you're transferring an app or site from a hosted account to a vps, that's a hassle too (is one click transfer too much to ask given the auth info to both accounts?)

even stuff like "one click passwordless SSH" would be cool (however, the right company could completely eliminate SSH from a hacker's toolkit).  i don't want to go in and have to setup my ssh keys.  download an app as part of the package and do all of it for me.  or one click "add users" and "group/permissions management" in a visual format.