Posted on 25 August 2011.
When I’m developing a site, I always setup a local development enviroment on my laptop. This is usually just an Apache server with a Virtual Host setup for each site.
One step that is required is to add an entry to the hosts file on my laptop so that the URL resolves to 127.0.0.1
Recently I have been working on a project that required lots of testing on mobile phones. This is where I ran into an issue. There is no way to change the hosts files on a iPhone without jailbreaking the phone.
Enter Charles…

Charles is a web debugging proxy. You can download it from here
I mainly use Charles to examine http requests made by a browser, usually to debug json packets. But it is also possible to use it as a http proxy that you can route iphone http traffic through. The magic bit is: any requests from the iPhone are also subject to the proxy machines hosts file.
Charles Setup
- Open Proxy > Proxy Settings.
- Take note of the Port number. The default is 8888
- Click the HTTP Proxy mode button.
iPhone Setup
- Open Settings > Wifi > Your Wifi Network Settings
- Under HTTP Proxy choose Manual
- Server: you dev machine’s ip address Port: 8888 Authnetication: Off
The iPhone will now use the hosts file on the proxy machine for any URL requests. Boom!
Posted on 22 March 2011.
Language One, Day One is Ruby:
Find:
Do:
-
Print the string “Hello, world”.
-
For the string “Hello Ruby”, find the index of the word “Ruby”..
-
Print your name 10 times.
-
Print the string “This is sentence number 1”, where the number 1 changes from 1 to 10.
-
Run a Ruby program from a file.
-
Write a program that picks a random number. Let a player guess the number, telling the player whether the guess is too low or too high.
Posted on 21 March 2011.
My order from Amazon arrived at work while I was away in Melbourne last week.
Thanks @animoller Thanks @animoller
One of the books was Seven Languages in Seven Weeks by Bruce Tate.
I’m going to post my attempts at the self study sections for each of the languages here. These are just to help me follow through with the book, but if someone finds them useful, then all the better.
In order, the languages are:
- Ruby
- Io
- Prolog
- Scala
- Erlang
- Clojure
- Haskell
Posted on 21 March 2011.
Language One, Day One is Ruby:
Find:
Do:
-
Print the string “Hello, world”.
-
For the string “Hello Ruby”, find the index of the word “Ruby”..
-
Print your name 10 times.
-
Print the string “This is sentence number 1”, where the number 1 changes from 1 to 10.
-
Run a Ruby program from a file.
-
Write a program that picks a random number. Let a player guess the number, telling the player whether the guess is too low or too high.