Posted by
Neil – March 9, 2010
I had an issue recently whereby Ack in my Textmate install would just hang with a spinner, yet still work just fine from the command line.
After some digging it transpires that this is related to me installing and mucking about with RVM, the Ruby version manager. Essentially, Textmate isn’t a big fan of this, so therefore needs a little hand-holding. Luckily it’s pretty straight forward:
Go to Preferences -> Advanced -> Shell Variables and add TM_RUBY as the variable and “/usr/bin/ruby” as the value.
Job done.
Posted by
Neil – January 27, 2010
I didn’t realise how easy this was, but it is very easy to simulate a slow connection in Mac OS X, which will help with testing sites for users that don’t have the blazing fast connections that us developers tend to have.
Why would you want to do this? Well, the primary use case I have is when testing sites that are heavy on Javascript, for instance, testing that everything is loaded up when it needs to be and that the latency of the connection isn’t breaking anything.
So how do we do it? Simple:
In terminal.app run the following:
sudo ipfw pipe 1 config bw 30Kbit/s delay 350ms
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80
This will set rules to limit all traffic on port 80 to 30Kbit/s with a latency of 350ms. Edit the commands to change the speed / ports as you require.
In order to undo this, simply run the following:
sudo ipfw delete 1
sudo ipfw delete 2
Simple when you know how
(Note that f you are using Safari to view the pages, you’ll need to use your Mac’s hostname or external IP address in the URL (for example, mymac.local rather than localhost).