Overooped
PHP: Timeout on file_get_contents
Since there doesn’t seem to be a single piece of documentation or example on the use of the context option for file_get_contents, and everyone’s actually setting the PHP app’s ini value for timeout (euugh) instead of doing it right, I thought I’d feed this to google:
‘http’ => array(
‘timeout’ => 1
)
)
);
file_get_contents(“http://google.com/”, 0, $ctx);
The unit on the timeout argument is seconds as a float; that is, it is possible to use fractions (e g set timeout to 0.1).
“So no matter how you cut it, in your life expectancy, you are going to see the peak of world oil production.”
Re: Firefox 3 vs. Safari 3
I agree with everything that Gruber writes about in his latest article. A friend of mine went majorly goddamned-mac-zealot on me and his article (had to explain not once but *twice* that Gruber wasn’t saying “FF should be exactly as Safari” but “Safari beats the Mac port of FF on a number of points” :P) All is well and good though, as he found a fix for the most annoying UI element of FF3 for me: single-click-selects-entire-URL. I almost screamed from frustration from just trying to edit the URL a few days ago. Here’s how to fix it, though:
- Go to about:config (type it in the location bar and type enter)
- Filter on “clickSelects”
- Double-click on the row that says “browser.urlbar.clickSelectsAll” to set it to false.
Now when you single-click in a Firefox location bar, it’ll place the caret in it; double click will select word; and triple-click will select the whole line, just like in a Mac app.
Addendum: Okay, so Voxar tried to convince me that Safari’s location bar was idiotic and illogical (of course only from reading Gruber’s article and not trying it out, even though he has a Mac on his desk :P), and challenged me: if Safari always highlights the first autocomplete entry when you type an url, wouldn’t it be VERY cumbersome to enter e g “http://daringfireball.net/2008/” when the only URL in your history is “http://daringfireball.net/2008/04/firefox_3_safari_3”? The answer is of course, no :) In Safari, you type “da[right-arrow]2008[backspace][enter]” and you’re done with it. The same scenario in Firefox would require you to type the entire URL in by hand, since the autocomplete would be completely useless (even the AwesomeBar would be stumped!). Now I remember why I love Safari :) (Watch It In Full Motion.)
An old blog entry of mine about my arch-nemesis build_hd_index. I once disabled it by chmod 000’ing the file. I have now learned that this is a very bad idea. The 10.5.2 Server updater has a new version of this file. When Installer tries to install it, it fails. However, it does not rollback, which means that your system has just been screwed.
Target Disk Mode and Pacifist are my very best friends.
